How to Use IntelliJ 2021.2.2 for JavaFX 17, JDK 17 and Scene Builder 16 on Windows 10 x64

preview_player
Показать описание
In this tutorial, I will show you how to setup IntelliJ IDEA 2021.2.2 for JavaFX 17.0.0.1, JDK 17, JavaFX Scene Builder 16 on Windows 10 x64. JavaFX 17 needs at least Java Development Kit (JDK) 11 or later.

This tutorial also shows you how to do modular and non-modular JavaFX programming and deploy an executable JavaFX 17 Jar.

You should download and install the following:

The Installed directories are as following:

C:\Program Files\Java\jdk-17
C:\Program Files\Java\javafx-sdk-17.0.0.1
C:\Users\Ken\AppData\Local\SceneBuilder
C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.2

With the release of JDK 11 in 2018, Oracle has made JavaFX part of the OpenJDK under the OpenJFX project. It means that Oracle JDK 11 is no longer comes with JavaFX 11. To continue use JavaFX, we may choose to use current long-term version (JDK 8) through March 2025 or use OpenJFX 11 or higher after integrated into installed JDK.

It means that you have to do certain things by yourself.

1. Create a new JavaFX project.

Add JDK and specify the path to the JDK home directory (for example, C:\Program Files\Java\jdk-17).

2. Add the JavaFX 16 library. You make sure your project is configured to run with JDK 11 or later, and you may add the JavaFX 17.0.0.1 library.

for example, C:\Program Files\Java\javafx-sdk-17.0.0.1\lib.

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

3. Use VM options to run the the application. You have to integrate JavaFX modules/jars into installed JDK if you use Java 11 or higher.

3.1 From the main menu, select Run | Edit Configurations.
3.2 Select Application | Main from the list on the left.
3.3 From the More options list, select Add VM options.
3.4 In the VM options field, specify the following options,

--module-path "C:\Program Files\Java\javafx-sdk-17.0.0.1\lib"

3.5 Apply the change and close the dialog.

#IntelliJ2021 #JavaFX17 #Java17 #SceneBuilder16
Рекомендации по теме
Комментарии
Автор

Can't find words to explain how thankful I am ... it's been 48 hours m trying to solve errors ..this is only video that helped me
May God give u everything whatever u want♥️

preetiranibishoyi
Автор

Can you make a video explaining how to setup JavaFX 17 with spring boot using maven

MrAvelino
Автор

Hey, thanks for the video that helps a lot. I have a problem though. See when i tried to run by docuble click to the jar file, it gives me "A Java exception has occured" message and I can't run it. My build is same JavaFX 17 and JDK17. But the Intellij version is 2024.1.2. Can you help me somehow please

onurkilicer
Автор

THANK YOU !!! I was trying to find the solution for 2 days, and you helped me. One more question please, how did you select all files at once in folder "bin", when you were creating Jar ? Whick keybind?

bonador
Автор

THANK YOU !!! You are a Lifesaver !!!

foerfinad
Автор

I am getting something like com.example.javafx not found

kaus
Автор

if i include springframework. from explore cannot open. in ide is ok.
if i java -jar --module-ath "c:\javafx\lib\" --add-modules javafx.controls, javafx.fxml demo.jar (i include lib springframework in javafx\lib) is run.

geliangzhu
Автор

@ken i dont have java icon on the jar files and it wont open what shall i install to run it im stuck..

bilal
Автор

my jar file after I build artifacts couldn't run althought I have done everything like you. I don't understand why

QuangPham-bclc
Автор

i cannot import images. can you show how? thank you so much

chaunguyen