How To Deploy Executable JavaFX 18 JAR Using IntelliJ 2021.3.3 on Windows 11 x64 (Fixed)

preview_player
Показать описание
This tutorial shows you how to deploy an executable JavaFX 18 application jar file using IntelliJ 2021.3.3 on Windows 11 x64. It contains JavaFX application with JavaFX library and DLL (.dll) files that can be accessed by a Windows program. In this way, you can run your JavaFX application by simply double clicking the jar file.

Important!!!

For IntelliJ 2021.3.3, Directory for META-INF/MAINFEST.MF: is not correct! It comes with C:\Users\Ken\IdeaProjects\demo\src\main\java or C:\Users\Ken\IdeaProjects\demo\src\main\resources, when you create a JAR file. As a result, when you click your JAR file, it does not run!

To fix this problem, you have to change Directory for META-INF/MAINFEST.MF: to C:\Users\Ken\IdeaProjects\demo\src, and then it will work. As far as I remember, we don't have this problem with older versions of IntelliJ 2021.3.x.

Java installation directory.

C:\Program Files\Java\jdk-18

JavaFX installation directory.

C:\Program Files\Java\javafx-sdk-18

Setting Environment Variables

JAVA_HOME="C:\Program Files\Java\jdk-18"

JAVA_HOME tells your OS where there Java installation directory lives.

PATH="%JAVA_HOME%\bin"

PATH specifies where the Java executable directory resides.

If it complaints about an existing MANIFEST.MF file, you can remove it from out/production/demo/META-INF/. demo refers to your project name.

VM options
--module-path "C:\Program Files\Java\javafx-sdk-18\lib"

JDK 18
JavaFX SceneBuilder 17.0.0
IntelliJ IDEA 2021.3.3
Windows 11 Pro x64

#JavaFX​​18 #ExecutableJar​​ #DeployJar​ #CreateJar
Рекомендации по теме
Комментарии
Автор

OMG IT WORK!! Thank you! I watch your previous and other's video and jar wont run at all. I almost give up but then I found this. I'm glad.

FongGamy
Автор

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

Edit: the problem was that my file name was not space free

mro
Автор

when i double click the file nothing happens

benbailor
Автор

doesnt work :( Why tf is it so hard to create exe file JetBrains?! It should be one click

cabron
Автор

Aaaa Soo close to solve my problem :((

luchonoprograma