My question resembles this question a lot but no answer was provided and my goal is slightly different as I want to end up with an executable: Automatic module VM options for jar file
So, I have run into a problem deploying my JavaFX application after Oracle removed the JavaFX Packager tool from JDK11+.
Prior to JDK11, I used the said packager tool to create an executable with associated data, before creating an installer with Inno Setup Compiler, which would then be passed around.
Now, my idea of an alternative consists of creating a fat jar (that can be run as stand alone, containing all used libraries) and afterwards create an executable from this.
My problem is that the created jar file cannot be run successfully without adding VM options like shown below.
My question is two-folded:
Is there a way to avoid adding these VM options when running the jar?
Or is there a smarter way to end up with an executable? (I am not interested in creating a batch file, also a possible solution should work with JDK12)
java -jar Project.jar
// Error: JavaFX runtime components are missing, and are required to run this application
java --module-path=%PATH_TO_FX% --add-modules=javafx.controls,javafx.fxml -jar Project.jar
Thanks in advance! Feel free to ask if anything is unclear.