Let's say I installed Oracle JDK 11 (just to make thing simpler). Then I downloaded Gluon's JavaFX 11 and unpacked in on top of JDK. Actually it doesn't matter where I unpack JavaFX (because my next aim is to make my own JRE installer based on OpenJRE). Then I am trying to start the application:
c:\Program Files\MyApp>"c:\Program Files\Java\jre-11\bin\java"
--module-path="c:\Program Files\Java\jre-11\lib"
--add-modules=javafx.controls
--add-modules=javafx.base -jar ./MyApp.jar
And I get this:
Error occurred during initialization of boot layer java.lang.LayerInstantiationException: Package jdk.internal.jrtfs in both module java.base and module jrt.fs
It I try to delete "jrs.fs" then my application crushes because some important system classes related to the class loader are missing. What is the proper way to start JavaFX applications with Java 11? And do I need to redistribute JavaFX every time with every application now (because now it's location must be specified in the command line that launches the application).