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

Опубликовано: 27 Сентябрь 2020
на канале: 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.


Смотрите видео Java 14 new features |Java Packaging Tool to create exe for install java application on windows онлайн без регистрации, длительностью 17 минут 34 секунд в хорошем hd качестве. Это видео добавил пользователь Java Beam 27 Сентябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 494 раз и оно понравилось 3 людям.