-
Bug
-
Resolution: Unresolved
-
P5
-
jfx11
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Can be reproduced with any Java version 11+ and JavaFX 11+ on any OS
A DESCRIPTION OF THE PROBLEM :
When using Java 11+ with JavaFX dependencies on the classpath an JavaFX application can not be started. With Java 11+ JavaFX is only useable when it is on the module-path. This is not an issue regarding JavaFX but Java / OpenJDK. JavaFX would work from the classpath. The cause of the problems is in the sun.launcher.LauncherHelper class that is part of the java.base module. This class checks ff the main class of a started application extends the âÂÂjavafx.application.Applicationâ class. If this is the case the application will only start if the âÂÂjavafx.graphicsâ is in the module-path (see sun.launcher.LauncherHelper.FXHelper.setFXLaunchParameters). If the module can not be found the application ends with System.exit(1) and an error message.
Some information about the âÂÂjavafx.application.Applicationâ class: This class defines the default lifecycle of a JavaFX application. Therefore a lot of applications directly extend this class for the main class of the application.
From my point of view such behaviour must not be part of the java.base module. Once JavaFX was removed from the JDK all references should have gone. If JavaFX would only be useable if it is on the moduelpath this must be check by JavaFX and not by OpenJDK. To be true it is not possible to have JavaFX on the module-path. You can easily create a basic main class that does not extend âÂÂjavafx.application.Applicationâ and call the main of a class that extend âÂÂjavafx.application.Applicationâ internally. By doing so an application would work. But this is really an ugly workarounds (see https://github.com/karakun/OpenWebStart/blob/master/documentation/faq/FAQ.adoc#how-to-run-openjfx-based-javafx-applications-with-openwebstart for a sample).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create an Java application and add JavaFX (javafx.graphics-win for example) to the class path
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Application starts normally
ACTUAL -
application ends (System.exit(1))
---------- BEGIN SOURCE ----------
see https://github.com/karakun/OpenWebStart/blob/master/documentation/faq/FAQ.adoc#how-to-run-openjfx-based-javafx-applications-with-openwebstart
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
see https://github.com/karakun/OpenWebStart/blob/master/documentation/faq/FAQ.adoc#how-to-run-openjfx-based-javafx-applications-with-openwebstart
FREQUENCY : always
Can be reproduced with any Java version 11+ and JavaFX 11+ on any OS
A DESCRIPTION OF THE PROBLEM :
When using Java 11+ with JavaFX dependencies on the classpath an JavaFX application can not be started. With Java 11+ JavaFX is only useable when it is on the module-path. This is not an issue regarding JavaFX but Java / OpenJDK. JavaFX would work from the classpath. The cause of the problems is in the sun.launcher.LauncherHelper class that is part of the java.base module. This class checks ff the main class of a started application extends the âÂÂjavafx.application.Applicationâ class. If this is the case the application will only start if the âÂÂjavafx.graphicsâ is in the module-path (see sun.launcher.LauncherHelper.FXHelper.setFXLaunchParameters). If the module can not be found the application ends with System.exit(1) and an error message.
Some information about the âÂÂjavafx.application.Applicationâ class: This class defines the default lifecycle of a JavaFX application. Therefore a lot of applications directly extend this class for the main class of the application.
From my point of view such behaviour must not be part of the java.base module. Once JavaFX was removed from the JDK all references should have gone. If JavaFX would only be useable if it is on the moduelpath this must be check by JavaFX and not by OpenJDK. To be true it is not possible to have JavaFX on the module-path. You can easily create a basic main class that does not extend âÂÂjavafx.application.Applicationâ and call the main of a class that extend âÂÂjavafx.application.Applicationâ internally. By doing so an application would work. But this is really an ugly workarounds (see https://github.com/karakun/OpenWebStart/blob/master/documentation/faq/FAQ.adoc#how-to-run-openjfx-based-javafx-applications-with-openwebstart for a sample).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create an Java application and add JavaFX (javafx.graphics-win for example) to the class path
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Application starts normally
ACTUAL -
application ends (System.exit(1))
---------- BEGIN SOURCE ----------
see https://github.com/karakun/OpenWebStart/blob/master/documentation/faq/FAQ.adoc#how-to-run-openjfx-based-javafx-applications-with-openwebstart
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
see https://github.com/karakun/OpenWebStart/blob/master/documentation/faq/FAQ.adoc#how-to-run-openjfx-based-javafx-applications-with-openwebstart
FREQUENCY : always
- relates to
-
JDK-8256362 JavaFX must warn when the javafx.* modules are loaded from the classpath
- Resolved
- links to
-
Review openjdk/jdk/978