-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Its very disheartening when you download the hellofx example app, extract it into a project directory, and load all the external jars as module path include in the IDE in an user library then Eclipse compiles and removes all the errors etc, but run button does not work.
Error: Could not find or load main class MyClass
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
edit: eclipse has a runtime setting of which modules on the module list to load, and its by default nothing, needs to be changed manually to MODULE-PATH.
edit: next error is hellofx.fxml loading error even if it has correct path.
edit: solution: fx:controller= variable needs correct class name.
why Java application requires fxml to run?
making a runnable jar from eclipse with including library jars in package is not working also when running with oracle java-21 jvm in java-17 compatibility mode.
additionally the instructions for modular eclipse ide getting hellofx running or app image do not work, both not finding either hellofx module or the jmod required files.
error when running with java -jar myapplication.jar from command line on windows 11 (same code works from eclipse run button):
Feb 17, 2024 1:32:25 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @971b07'
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:263)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:671)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:62)
Caused by: java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:275)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:671)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.base/java.lang.Thread.run(Thread.java:1583)