This is a JavaFX deploy example for Windows OS. Ultimately, it produces a Windows Installer that includes a custom JRE.
End-users can install the program via a small (28MB
) exe
file and run it immediately using the generated desktop shortcut without the need for additional JRE installations.
The actual build process involves the following steps:
- Bundling dependencies using
module-info.java
or thejdeps
tool - Creating a runtime image using the
jlink
tool - Packaging as an installer using the
jpackage
tool
In this example, JavaFX-Maven-Plugin and JPackage-Maven-Plugin plugins are used instead of direct commands.
Firstly, to create the Windows Installer, please install Wix. Install wix311.exe
.
Then, build using the following command:
.\mvnw clean javafx:jlink jpackage:jpackage
The output can be found in the target/dist
folder.