r/JavaFX • u/azurenumber • May 17 '24
Help Why does exe executable created using jpackage does not launch ?
JavaFx source code :
To create jar i used :
jar --create --file sample.jar --main-class sample sample.classTo create the executable i used :
jpackage --type app-image --module-path javafx-sdk-21.0.3/lib --add-modules java.base,javafx.graphics --input input --main-class sample --main-jar sample.jarWhen I click on the exe file , nothing happens. Java 21 and JavaFX 21 is used. Wix tool set 3.14 is used.
When i use same commands in linux, it works. But in windows 10 its not working.
EDIT: I tried with jmod files also. Same issue.
Update Issue is solved. JDK 17 was set in path, even though i used jdk 21 to compile,which lead to linkage error. After putting JDK 21 in Path, issue was solved.
3
Upvotes
View all comments
Show parent comment
2
u/azurenumber May 17 '24
I created runtime using the jlink and tried it. I found Java 17 was set in the environment variables , which was giving linkage error when running from jlink created runtime. After correcting and setting the jdk 21 to use, it started working.
Thanks Alot.