I'm doing my first java project and would like to use the JavaFX GUI. I was able to compile it to the executable jar, the problem is that the only one way to run it is to have the jdk-14 computer on my computer( because I use java 14) and use the command "java -jar NameJar.jar". However, I would like to open it by double-clicking the program icon, but I have not found how to do it.I would like to know how to do it so that it opens by double clicking on the icon.
Take a look at jpackage, a new standard tool in Java 14 for packaging self-contained Java applications. It looks like this is exactly what you need.
Command to build (roughly):
jpackage --name <name here> --input lib --main-jar NameJar.jar --main-class <main class here> --type app-image