简体   繁体   中英

Export JavaFX project as executable jar or exe

Hi I've finished my JavaFx project and now I want to export it as a.exe file

The problem is that my JavaFX project use VM arguments

--module-path D:\ProjectDirectory\javafx-sdk-11.0.2\lib --add-modules=javafx.controls,javafx.fxml

I export the executable jar file and I try to run it with the argument like this

java -jar D:\Project.jar --module-path D:\ProjectDirectory\javafx-sdk-11.0.2\lib --add-modules=javafx.controls,javafx.fxml

When I execute that program I receive the next error

Error: JavaFX runtime components are missing, and are required to run this application

The way to go is to use the jpackage tool to package your application. Have a look at the documentation here: https://docs.oracle.com/en/java/javase/16/jpackage/packaging-overview.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM