You are not logged in.

#1 2020-03-28 15:33:56

chazy
Member
Registered: 2019-10-11
Posts: 7

Running JavaFX 13 in Eclipse 2020.03

After reading the wiki, installing javafx and setting it up in eclipse, this exception is shown when I try to run a new JavaFX project:

Exception in Application start method
java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.ExceptionInInitializerError
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.createTKStage(QuantumToolkit.java:600)
    at javafx.graphics/javafx.stage.Stage.doVisibleChanging(Stage.java:1154)
    at javafx.graphics/javafx.stage.Stage$1.doVisibleChanging(Stage.java:182)
    at javafx.graphics/com.sun.javafx.stage.StageHelper.visibleChangingImpl(StageHelper.java:57)
    at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanging(WindowHelper.java:73)
    at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1064)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
    at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1174)
    at javafx.graphics/javafx.stage.Window.show(Window.java:1189)
    at javafx.graphics/javafx.stage.Stage.show(Stage.java:273)
    at application.Main.start(Main.java:17)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
    ... 1 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name com.sun.javafx.tk.quantum.QuantumMessagesBundle, locale en_US
    at java.base/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2055)
    at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1689)
    at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1582)
    at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1556)
    at java.base/java.util.ResourceBundle.getBundle(ResourceBundle.java:932)
    at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.<clinit>(WindowStage.java:101)
    ... 21 more
Exception running application application.Main

I've installed the following packages: `java-openjfx` and `java-openjfx-src`. In eclipse I also installed `e(fx)clipse` and manually configured a new user library for adding JavaFX to the project:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<eclipse-userlibraries version="2">
    <library name="JavaFX" systemlibrary="false">
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx.base.jar"/>
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx.controls.jar"/>
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx.fxml.jar"/>
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx.graphics.jar"/>
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx.media.jar"/>
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx.swing.jar"/>
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx.web.jar"/>
        <archive path="/usr/lib/jvm/java-13-openjdk/lib/javafx-swt.jar"/>
    </library>
</eclipse-userlibraries>

Last but not least, the VM args: `--module-path "/usr/lib/jvm/java-13-openjdk/lib" --add-modules=javafx.controls,javafx.fxml`.

So after configuring eclipse the problem seems to be related to the library: "Caused by: java.util.MissingResourceException: Can't find bundle for base name com.sun.javafx.tk.quantum.QuantumMessagesBundle".

I don't know if it's relevant here, so I'll just mention it. When I create a new project, in the libraries I can see under Classpath a library named "JavaFX SDK" which is empty except for some options (access rules, external annotations, etc...), there are no files inside this library. I guess this is the intended way for eclipse to load FX but for some reason it cannot load them? The user library that I manually created is under Modulepath and its name is just JavaFX.

Can I get some help with this? Thanks.

Offline

#2 2020-03-28 17:42:55

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: Running JavaFX 13 in Eclipse 2020.03

chazy wrote:
Caused by: java.util.MissingResourceException: Can't find bundle for base name com.sun.javafx.tk.quantum.QuantumMessagesBundle, locale en_US

So after configuring eclipse the problem seems to be related to the library: "Caused by: java.util.MissingResourceException: Can't find bundle for base name com.sun.javafx.tk.quantum.QuantumMessagesBundle".

You missed the most important part of the error message: the "locale en_US" portion means that it can't find the resource bundle for language en_US. Assuming that is your base language, it probably means you're missing a JavaFX module that has the base language in it I don't use JavaFX so I couldn't tell you which one, but It probably is a module/package with a bunch of .properties files in it.

Offline

#3 2020-03-28 18:04:54

chazy
Member
Registered: 2019-10-11
Posts: 7

Re: Running JavaFX 13 in Eclipse 2020.03

Ok, so where would I get these files? Shouldn't they be included in either of the packages I have installed? `java-openjfx` or `java-openjfx-src`?

Offline

#4 2020-03-30 17:59:10

chazy
Member
Registered: 2019-10-11
Posts: 7

Re: Running JavaFX 13 in Eclipse 2020.03

The only solution for this atm is to download the library from the official website.

Offline

Board footer

Powered by FluxBB