Home >Java >javaTutorial >How Can I Deploy a JavaFX 11 Desktop Application with a Bundled JRE?
With Oracle's discontinuation of Java Web Start, JavaFX developers now face the challenge of finding an alternative deployment method for their applications. This article explores the technique of bundling a JavaFX 11 application with a JRE, providing a comprehensive solution for easy distribution and updates.
The process involves converting the application into a module, linking it to required modules, and creating an image file tree containing executables for distribution.
The first step is to turn the application into a module by creating a module-info.java file with a unique module name.
Build the application using a module path instead of a classpath.
Convert the JAR file into a JMOD using the JDK's jmod tool.
Link the JMOD and its dependencies into an image file tree using the jlink command.
Zip or tar and distribute the entire image file tree. The executable can be found in the bin directory.
To create images for other platforms, use the --target-platform option with jmod and explicitly include the jmods directory of the target platform in jlink.
Native Binaries: The image includes native binaries, so separate images must be created for each platform.
Alternative Deployment Options:
The above is the detailed content of How Can I Deploy a JavaFX 11 Desktop Application with a Bundled JRE?. For more information, please follow other related articles on the PHP Chinese website!