问题
I hope this question does not seem to basic but I could not find any good documentation despite researching for hours.
I use Maven (Version 3.3.9) for my JavaFX (Version 11.0.2) with JDK 13.0.1 project and want to build an EXE. What is the easiest way to do this?
All my researchs stucked somewhere.
Following this documentation, I tried to integrate ant-tasks. But the documentation required ant-javafx.jar
to be in the jdk_home/lib
directory which doesn't make sense for JDK 13 since it doesn't come with JavaFX.
But this was the latest official documentation where I could find something about Ant Task. So I guessed Ant Task does not work for JDK13 anymore, am I wrong? I hope this does not seem like a dumb assumption but I could not find a newer documentation.
I have also tried the zenjava plugin but the latest commit is 2 years ago, and when I try to use it I get an error
Could not find artifact javafx-packager:javafx-packager:jar:1.8.0_20 at specified path C:\Program Files\Java\jdk-13.0.1/../lib/ant-javafx.jar
Since I've read that javafx-packager
was renamed to java-packager
a longer time ago (sorry, don't remember, where I've read this) I assumed that zenjava is not up to date for JDK 13.
I couldn't find anything else.
Thank you :)
回答1:
The first thing to do is to upgrade your Java and JavaFX versions to 14. Then you can use the new jpackage tool, which does exactly what you need. How to do all this with Maven is described in this tutorial, which I did together with Dirk Lemmermann. Maybe that helps.
JPackageScriptFX
来源:https://stackoverflow.com/questions/60772873/how-to-deploy-a-javafx-project-with-maven-to-an-exe