JavaFX 15 Tutorial 65 - Executable JavaFX 17 Application JAR File (Updated)

Опубликовано: 04 Октябрь 2024
на канале: Ken
5,158
58

In this tutorial, you will learn how to create a standalone JavaFX 17 application JAR file. This JAR file will include both the JavaFX application code and necessary resources, making it easy to launch by simply double-clicking the file.

The following VM options will be used:

--module-path "C:\Program Files\Java\javafx-sdk-17.0.1\lib"
--add-modules javafx.controls,javafx.fxml

Leaving a space between the two module names, like this: --add-modules=javafx.controls, javafx.fxml, may result in a syntax error. Therefore, it is important to ensure that there is no space between the module names when using the --add-modules option with JavaFX.

JDK 17.0.1
JavaFX 17.0.1
JavaFX SceneBuilder 17.0.0
IntelliJ IDEA 2021.3
Windows 11 x64