If you used to execute jar files in command line this way before:
... so here is the fix:
Or double-clicking on the JAR file, you will probably end up having this error showing up:java -jar MyProgram.jar
Error: JavaFX runtime components are missing, and are required to run this application
... so here is the fix:
- Create a .txt file
- copy paste this into this file:
-
B4X:
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.