Export JavaFX 11 Project into executable jar - quick and easy (2020)

The Code Implementation · 14K views · 2020 · 0:59

Open on YouTube

Software practice, open source & careersTesting, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when a packaged JavaFX jar won't run, because it shows how to add the JavaFX native library files when building the IntelliJ artifact.

Recommended by 2 people across 2 different months, 2020 to 2021.

What it is

A one-minute screen recording showing how to export a JavaFX 11 (Gluon) project from IntelliJ as an executable jar that runs on any Windows machine. It fixes the 'JavaFX runtime components are missing' and 'Graphics Device initialization failed for d3d, sw' errors by bundling the JavaFX native library files into the artifact.

What people said

Recommends Vladimir Pechenevskyi · 2021-01 · Stack Overflow · on “Cannot run jar file of JavaFX program. It's just won't run”

So I found solution on Youtube link : [this video] I just needed to add .dll files from javafx's bin folder, when i was making an artifact.

Recommends YHStan · 2021-06 · Stack Overflow · on “How to solve "Graphics Device initialization failed for : d3d, sw" when running a java Jar file with JavaFx”

Also, found this where you package the JavaFX dll into the jar, then you do not need to add modules in command prompt [this video]

Cites Afik.M · 2020-11 · Stack Overflow · on “Error: Could not find or load main class Caused by: java.lang.ClassNotFoundException”

I'm trying to create an Exe file for my JavaFX project, after building the artifacts I try to run the jar by java -jar name.jar and I get the error at the title. I was following the answer here What does "Could not find or load main class" mean? [LINK] but nothing helped. Then i tried to do this method [this video] and it still happened. In the project i use mssql-jdbc-8.4.1.jre14.jar , mysql-connector-java-5.1.49.jar , jfoenix-9.0.10.jar and of course the JavaFx lib. The values of CLASSPATH in the system variable are : CLASSPATH [LINK] The libs at the project: libs [LINK] MANIFEST: Manifest-Version: 1.0 Main-Class: MainPackage.Main Class-Path: C:\Users\amttr\Desktop\pol\javafx-sdk-11.0.2\lib\* C