Java Tools Tutorials - Herong's Tutorial Examples - v6.24, by Herong Yang
jpackage - What Is It
This section describes what is 'jpackage' - a command line tool that allows you to create a binary distribution package of your Java application for a specific computer platform in a specific format.
What Is "jpackage"? - "jpackage" is a command line tool that allows you to create a binary distribution package of your Java application for a specific computer platform in a specific format.
Currently, "jpackage" supports these package formats for different platform: "app-image", "exe", "msi", "rpm", "deb", "pkg", and "dmg".
If you have %java_home%\bin directory included in "path" the environment variable, you can run "jpackage --help" to get the usage information:
herong> jpackage --help WARNING: Using incubator modules: jdk.incubator.jpackage Usage: jpackage <options> Sample usages: -------------- Generate an application package suitable for the host system: For a modular application: jpackage -n name -p modulePath -m moduleName/className For a non-modular application: jpackage -i inputDir -n name \ --main-class className --main-jar myJar.jar From a pre-built application image: jpackage -n name --app-image appImageDir Generate an application image: For a modular application: jpackage --type app-image -n name -p modulePath \ -m moduleName/className For a non-modular application: jpackage --type app-image -i inputDir -n name \ --main-class className --main-jar myJar.jar To provide your own options to jlink, run jlink separately: jlink --output appRuntimeImage -p modulePath -m moduleName \ --no-header-files [<additional jlink options>...] jpackage --type app-image -n name \ -m moduleName/className --runtime-image appRuntimeImage Generate a Java runtime package: jpackage -n name --runtime-image <runtime-image> ...
For more information, see "jpackage" reference page at https://docs.oracle.com/en/java/javase/17/docs/specs/man/jpackage.html.
Table of Contents
javac - The Java Program Compiler
java - The Java Program Launcher
►jpackage - Binary Package Builder
"jpackage -t dmg" - Package for macOS
"jpackage -t pkg" - Package for macOS
"jpackage -t msi" - Package for Windows
javadoc - The Java Document Generator
jdeps - The Java Class Dependency Analyzer
jdeprscan - The Java Deprecated API Scanner
jcmd - The JVM Diagnostic Tool
jconsole - Java Monitoring and Management Console
jstat - JVM Statistics Monitoring Tool
jhsdb - The Java HotSpot Debugger
jvisualvm (Java VisualVM) - JVM Visual Tool
javap - The Java Class File Disassembler
keytool - Public Key Certificate Tool
jrunscript - Script Code Shell
native2ascii - Native-to-ASCII Encoding Converter