Link JavaFX in a jar
已回答
Hello, i would like to know how you link a local javafx in a jar.
Execute the main class in IntelliJ works, and a global path to a complete javafx library too.
I am not sure if i have to separate javafx.base, javafxgraphics etc or just use javafx in the command line.
What is the best location for the lib directory, inside or outside of the jar ?

MANIFEST.MF :
Manifest-Version: 1.0
Main-Class: helloworld.main.Main
HelloWorld.sh :
#!/bin/bash
java --module-path /lib/javafx --add-modules javafx.base,javafx.graphics -jar HelloWorld.jar
Terminal :
sh ./HelloWorld.sh
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.base not found
请先登录再写评论。
Hello,
Please see the related discussion at https://stackoverflow.com/questions/53533486/how-to-open-javafx-jar-file-with-jdk-11 .
It seems that the configuration has not been fully patched. Try using the following command:
If you're using JavaFX SDK 14 together with OpenJDK 14, add one more option:
I am still on the JDK 13 (and IntelliJ 2020), but nothing seems to work when the lib is inside of the jar.
The solution has been to move the lib outside of the jar and to normalize the paths because on Linux a start dot is required (i thought that it was only for a launch). The lib directory seems to be the best location for any jar file, and the root for the launcher, thus this command line works :
Thank you for your help.