Java 14 new features |Java Packaging Tool to create exe for install java application on windows

Published: 27 September 2020
on channel: Java Beam
494
3

Java 14 new features |Java Packaging Tool to create exe for install java application on windows


Step
Create your project/required mail java class
Compile
Run to check if it is working fine
Step
Create a executable jar file.
jar -cfe jpDemo3.jar org.java14.JPackDemo org/java14/*.class
Step
Install Wix 3.0 or able and set to path.
Download wix from
Step
Use JPackaging tool/Command line utility to create exe file
Command to create exe file:
jpackage --input . --name JPackageDemoApp --main-jar JPKGDemo.jar --main-class org.java14.JPackDemo --type exe --java-options '--enable-preview' --win-shortcut

Step
Install your exe into ur window desktop/laptop

jpackage is a command-line tool to create native installers and packages for Java applications.

It's an incubating feature under the jdk.incubator.jpackage module.

3. Why jpackage?
It's standard practice while distributing software to deliver an installable package to the clients This package is compatible with the user's native platform and hides the internal dependencies and setup configurations. For example, we use DMG files on macOS and MSI/exe files on Windows.

This allows the distribution, installation, and uninstallation of the applications in a manner that's familiar to our end users.

jpackage allows developers to create such an installable package for their JAR files. The user doesn't have to explicitly copy the JAR file or even install Java to run the application. The installable package takes care of all of this.


Watch video Java 14 new features |Java Packaging Tool to create exe for install java application on windows online without registration, duration 17 minute 34 second in high hd quality. This video was added by user Java Beam 27 September 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 494 once and liked it 3 people.