0

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.

2
  • 1
    JavaFX was moved to a separate module in Java 11 (and later). You can use jlink to create a JRE that includes the JavaFX modules, and then use that when you build your .exe. Also note JDK14 include the jpackage tool, which will do both steps (running jlink and creating the native package) in one call. Commented Nov 10, 2020 at 13:47
  • You can try my solution explained here : stackoverflow.com/questions/61919197/… Commented Jan 24, 2021 at 20:12

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

1 Comment

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 ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.