How to deploy JavaFx 12+ app as standalone application? Every I create JAR file and convert it to .exe using launcher it fails to run. And the error indicates that it lacks JavaFX UI Components, it only works if I use jdk 10 and below. My IDE is IntelliJ Community Edition.
1 Answer
While JavaFX was moved out of the standard distribution of the JDK/JRE in Java 11, there are still several OpenJDK vendors that produce builds including the JavaFX modules. Try using a build from Azul or Bellsoft that is marked as "full" or "fx".
https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk
https://bell-sw.com/pages/downloads/
Otherwise the solution is to download the JavaFX SDK modules and create a JRE that includes the JavaFX modules with jlink. https://openjfx.io/openjfx-docs/#install-javafx
1 Comment
Kingstone Job
Thanks, I will try all these two solutions, currently I simply recompile the project with jdk10 though I had to modify the code two a little bit for example everywhere that I used the string.isBlank() method has to be revisited among other ...
jlinkto create a JRE that includes the JavaFX modules, and then use that when you build your .exe. Also note JDK14 include thejpackagetool, which will do both steps (runningjlinkand creating the native package) in one call.