GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.tutorialspoint.com — Java - Packaging Tools
Selected Reading
Java - Packaging ToolsIn Java 14, a new packaging tool, jpackage was introduced to replace javapackager. javapackager was part of JavaFX kit and was introduced in Java 8. As Java 11 onwards, JavaFX is not a standard feature of Java API, javapackager is not a part of the standard offering. jpackage serves this purpose. jpackage enables developers to package the jar file in a native installable format like exe/msi for Windows, pkg/dmg for MacOS and so on. Developer can use jlink to compress the required JDK modules to minimum modules and use the jpackage to create a lightweight image. Need of jpackagerWhen software is to be distributed, the preferred way is to deliver an installable package to the end-user. This installable package generally contains the JDK, the modules, any dependent files, and configurations and provides the user with a familiar way to install the software. Users should not be required to install JRE or JDK as a prerequisite to run the Java application. jpackage handles all these cases and packages all the required files along with JRE/JDK into a native installer. Command Line Options for jpackagerjpackage is a command line tool and provides various options to customize installable softwares. Following are some of the features that jpackager provides:
PrerequisiteFolowing are the prerequisite to use jpackager tool to prepare a installable.
Create a PackageWe can create the package using following command: Syntaxjpackage --input lib \ --name Tester \ --main-jar Tester.jar \ --main-class com.tutorialspoint.Tester \ --type msi \ --java-options '--enable-preview' Where
This command will create a MSI file which can be installed on Windows and application can be used like any other software. Example of a Packagepublic class APITester {
public static void main(String[] args) {
System.out.println("Welcome to TutorialsPoint.");
}
}
Compile and Run the program $javac APITester.java $jar cf APITester.jar APITester.class OutputFor windows executable, you need to download WiX Toolset v3.11.2(wix311-binaries.zip) and add the toolkit to your path. Once jar is created and path is set, put jar in a folder called lib and run the following command to create a windows MSI installer. $jpackage --input lib --name APITester --main-jar APITester.jar --main-class APITester --type msi Advertisements
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |