


How to Deploy a JavaFX 11 Desktop Application with a JRE Using Modern Modular Packaging?
Deploying a JavaFX 11 Desktop Application with a JRE
Modern Java Module-Based Packaging
Oracle's discontinuation of Java Web Start has necessitated developers to adopt new deployment mechanisms for JavaFX applications. Deploying JavaFX 11 applications involves bundling them with a JRE, following a modular approach.
Creating a Module Descriptor
The first step is to convert your application into a module by creating a module-info.java file with a unique module name.
module com.mcs75.businessapp { exports com.mcs75.desktop.businessapp; requires java.logging; requires transitive javafx.graphics; requires transitive javafx.controls; }
Compiling, Packaging, and JMod Creation
Build using a module path instead of a classpath. Create a modular jar using the jar command. Then, create a jmod using the JDK's jmod tool.
javac -Xlint -g -d build/classes --module-path /opt/gluon-javafx/lib \ src/java/com/mcs75/desktop/businessapp/*.java jar -c -f build/mybusinessapp.jar -C build/classes . jmod create --class-path build/mybusinessapp.jar \ --main-class com.mcs75.desktop.businessapp.BusinessApplication \ build/modules/mybusinessapp.jmod
Linking the Image
Finalize the deployment by assembling the modules and a minimal JRE using the jlink command.
jlink --output build/image \ --module-path build/modules:/opt/gluon-javafx/lib \ --add-modules com.mcs75.businessapp \ --launcher MyBusinessApp=com.mcs75.businessapp
Distributing the Application
Package and distribute the entire image file tree as a zip or tar.gz. The executable script for users to run is located in the image's bin directory.
Cross-Platform Deployment
To create images for other platforms, specify the target platform in the jmod command using the --target-platform option and explicitly include the appropriate JDK's jmods directory.
This approach provides a modern and efficient way to deploy JavaFX 11 desktop applications with a JRE, without relying on discontinued technologies like Web Start.
The above is the detailed content of How to Deploy a JavaFX 11 Desktop Application with a JRE Using Modern Modular Packaging?. For more information, please follow other related articles on the PHP Chinese website!

Java'splatformindependencemeansdeveloperscanwritecodeonceandrunitonanydevicewithoutrecompiling.ThisisachievedthroughtheJavaVirtualMachine(JVM),whichtranslatesbytecodeintomachine-specificinstructions,allowinguniversalcompatibilityacrossplatforms.Howev

To set up the JVM, you need to follow the following steps: 1) Download and install the JDK, 2) Set environment variables, 3) Verify the installation, 4) Set the IDE, 5) Test the runner program. Setting up a JVM is not just about making it work, it also involves optimizing memory allocation, garbage collection, performance tuning, and error handling to ensure optimal operation.

ToensureJavaplatformindependence,followthesesteps:1)CompileandrunyourapplicationonmultipleplatformsusingdifferentOSandJVMversions.2)UtilizeCI/CDpipelineslikeJenkinsorGitHubActionsforautomatedcross-platformtesting.3)Usecross-platformtestingframeworkss

Javastandsoutinmoderndevelopmentduetoitsrobustfeatureslikelambdaexpressions,streams,andenhancedconcurrencysupport.1)Lambdaexpressionssimplifyfunctionalprogramming,makingcodemoreconciseandreadable.2)Streamsenableefficientdataprocessingwithoperationsli

The core features of Java include platform independence, object-oriented design and a rich standard library. 1) Object-oriented design makes the code more flexible and maintainable through polymorphic features. 2) The garbage collection mechanism liberates the memory management burden of developers, but it needs to be optimized to avoid performance problems. 3) The standard library provides powerful tools from collections to networks, but data structures should be selected carefully to keep the code concise.

Yes,Javacanruneverywhereduetoits"WriteOnce,RunAnywhere"philosophy.1)Javacodeiscompiledintoplatform-independentbytecode.2)TheJavaVirtualMachine(JVM)interpretsorcompilesthisbytecodeintomachine-specificinstructionsatruntime,allowingthesameJava

JDKincludestoolsfordevelopingandcompilingJavacode,whileJVMrunsthecompiledbytecode.1)JDKcontainsJRE,compiler,andutilities.2)JVMmanagesbytecodeexecutionandsupports"writeonce,runanywhere."3)UseJDKfordevelopmentandJREforrunningapplications.

Key features of Java include: 1) object-oriented design, 2) platform independence, 3) garbage collection mechanism, 4) rich libraries and frameworks, 5) concurrency support, 6) exception handling, 7) continuous evolution. These features of Java make it a powerful tool for developing efficient and maintainable software.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools
