Java 14 new features |Java Packaging Tool to create exe for install java application on windows
Step#1:
Create your project/required mail java class
Compile
Run to check if it is working fine
Step#2:
Create a executable jar file.
jar -cfe jpDemo3.jar org.java14.JPackDemo org/java14/*.class
Step#3:
Install Wix 3.0 or able and set to path.
Download wix from https://wixtoolset.org/.
Step#4:
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#5:
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.
#JavaBeam #PackagingToolInJava14 #JDK14NewFeatures #Java
En esta página del sitio puede ver el video en línea Java 14 new features |Java Packaging Tool to create exe for install java application on windows de Duración hora minuto segunda en buena calidad , que subió el usuario Java Beam 27 septiembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 568 veces y le gustó 3 a los espectadores. Disfruta viendo!