Export JavaFX 11, 15 or 17 projects into an executable jar file with IntelliJ [2022]
Why Stack Overflow recommends it
Stack Overflow users link it when answering how to build a runnable jar from a JavaFX 11+ project in IntelliJ, since the Project Structure artifact steps are easier to follow on screen.
Recommended by 3 people across 3 different months, 2021 to 2023.
What it is
A short screen-recorded tutorial by Daniel Smidstrup on turning a JavaFX 11, 15 or 17 project into an executable jar file using IntelliJ IDEA's artifact settings. It is a Windows-only walkthrough aimed at beginners who hit errors when packaging modular JavaFX apps.
What people said
Recommends Ahmad Ellamey · 2021-05 · Stack Overflow · on “Build and deploy javafx application using java11”
i have the same problem , after a lot of searching i found the solution on youtube with this video , the link for the video : [this video] you have to add all (.dill) files from your JavaSDKFX File on your Computer To the libs that you are going to Set in the Artifact , check the link for more obvious Info .
Recommends Oleg Boldov · 2022-08 · Stack Overflow · on “The executable jar file opens via the command line, but does not open via a double click”
in intellij idea, in the project structure tab, I created a jar artifact, added everything I needed from javafx to it, and in the build tab, I just created it. I did everything according to this video [this video] @SedJ601
Recommends foopeen · 2023-07 · Stack Overflow · on “How to create a default javafx project Jar file successfully on IntelliJ IDEA without error?”
this answer is based on Random code's Youtube content (Windows Based) [this video] There are 2 critical things(but not so complicated) to note here: 1. In order to avoid any error, we have to create a new Java Class that runs the main without any extends. X public class HelloApplication extends Application X ✓ public class YourMain ✓ In Mac, select your folder that has your main java class, in my case, my HelloApplication.java is in com.example.test folder, so i select the com.example.test , then right-click > New > Java Class and name your new Java Class, in my case i named it "Main" (it will create Main.java), and this new Class will have the same level as your "com.example.yourproject" folder
Cites JonR85 · 2022-12 · Stack Overflow · on “Issue JavaFX exporting a runnable Jar file”
JavaFX (the last I checked) needs a starter class. It's literally just a class that calls your main class. Something like: package MainApp; public class Starter { public static void main(String[] args) { Main.main(args); } } Then in your IDE, when you compile your jar, you have to select the Starter class. Depending on the JDK you have, you may also have to add the JavaFX library into the artifacts (IntelliJ: File > Project Structure > Artifacts ). [this video]