Home > Java > javaTutorial > How Can I Deploy JavaFX 11 Desktop Applications with a Bundled JRE?

How Can I Deploy JavaFX 11 Desktop Applications with a Bundled JRE?

Barbara Streisand
Release: 2024-12-04 13:09:13
Original
523 people have browsed it

How Can I Deploy JavaFX 11 Desktop Applications with a Bundled JRE?

Deploying JavaFX 11 Desktop Applications with a JRE

JavaFX 11 has removed the Web Start deployment option available in Java 8. To continue deploying applications with bundled JREs, developers need to follow a more modular approach.

Building the Application

  1. Create a module descriptor: Declare the application module with its dependencies in a module-info.java file.
  2. Compile with module path: Use --module-path to specify the module dependencies during compilation.
  3. Create JAR: Build a modular JAR by compiling the classes and packaging them into a JAR file.
  4. Convert JAR to JMOD: Create a JMOD (Java Module) file using the jmod tool, specifying dependencies and the main class.

Creating the Image

  1. Link JMODs: Use jlink to link the application JMOD and its dependencies into an image.
  2. Create Launcher Executable: Specify a launcher executable name using --launcher to simplify execution.

Distributing the Application

  1. Package the Image: Distribute a ZIP or TAR.GZ containing the image tree, including the launcher executable.
  2. Create Native Installer (Optional): Use jpackage to create native installers for different platforms.

Cross-Building for Different Platforms

  1. Acquire JDKs: Obtain JDKs for target platforms and extract them to separate directories.
  2. Specify Target Platform: Pass the target platform to jmod and jlink using --target-platform option.
  3. Include External JDK JMODs: Explicitly include the JMODs of the foreign JDK using --module-path.

The above is the detailed content of How Can I Deploy JavaFX 11 Desktop Applications with a Bundled JRE?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template