jmon Well-Known Member Licensed User Longtime User Sep 3, 2019 #1 If you used to execute jar files in command line this way before: java -jar MyProgram.jar Click to expand... Or double-clicking on the JAR file, you will probably end up having this error showing up: Error: JavaFX runtime components are missing, and are required to run this application Click to expand... ... so here is the fix: Create a .txt file copy paste this into this file: Code: Copy set JAVADIR="C:\java\jdk-11.0.1\jdk-11.0.1" set JARFILE="C:\temp\MyProgram.jar" set STARTDIR="C:\temp" cd %STARTDIR% %JAVADIR%\bin\java.exe --module-path %JAVADIR%\javafx\lib --add-modules=javafx.controls,javafx.fxml,javafx.web -jar %JARFILE% PAUSE Modify JAVADIR, STARTDIR and JARFILE variables with the location to your JDK and the location of the jar file you want to execute. Save the txt file Rename the extension of the ".txt" file to ".bat" Double click the BAT file.
If you used to execute jar files in command line this way before: java -jar MyProgram.jar Click to expand... Or double-clicking on the JAR file, you will probably end up having this error showing up: Error: JavaFX runtime components are missing, and are required to run this application Click to expand... ... so here is the fix: Create a .txt file copy paste this into this file: Code: Copy set JAVADIR="C:\java\jdk-11.0.1\jdk-11.0.1" set JARFILE="C:\temp\MyProgram.jar" set STARTDIR="C:\temp" cd %STARTDIR% %JAVADIR%\bin\java.exe --module-path %JAVADIR%\javafx\lib --add-modules=javafx.controls,javafx.fxml,javafx.web -jar %JARFILE% PAUSE Modify JAVADIR, STARTDIR and JARFILE variables with the location to your JDK and the location of the jar file you want to execute. Save the txt file Rename the extension of the ".txt" file to ".bat" Double click the BAT file.
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2019 #2 This is a good solution for B4J developers. If you want to distribute your app then you should use B4JPackager 11 to build a standalone package. Upvote 0
This is a good solution for B4J developers. If you want to distribute your app then you should use B4JPackager 11 to build a standalone package.