1 ---
   2 # Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
   3 #
   4 
   5 title: 'JPACKAGE(1) JDK @@VERSION_SHORT@@ | JDK Commands'
   6 date: 2019
   7 lang: en
   8 ---
   9 
  10 ## Name
  11 
  12 jpackage - tool for packaging self-contained Java applications.
  13 
  14 ## Synopsis
  15 
  16 `jpackage` *mode* \[*options*\]
  17 
  18 *mode*
  19 :   where mode is one of:
  20 :       create-app-image
  21             Generates a platform-specific application image.
  22 :       create-installer
  23             Generates a platform-specific installer for the application.
  24 
  25 
  26 *options*
  27 :   Command-line options separated by spaces. See [jpackage Options].
  28 
  29 ## Description
  30 
  31 The `jpackage` tool will take as input a Java application and a Java run-time image, and produce a Java application image that includes all the necessary dependencies. It will also be able to produce a native package in a platform-specific format, such as an exe on Windows or a dmg on macOS. The tool will have options that allow packaged applications to be customized in various ways.
  32 
  33 
  34 ## jpackage Options
  35 
  36 ### Generic Options:
  37 
  38 `@`*filename*
  39 :   Read options and/or mode from a file
  40     This option can be used multiple times.
  41 
  42 `--app-version` *version*
  43 :   Version of the application and/or installer
  44 
  45 `--copyright` *copyright string*
  46 :   Copyright for the application
  47 
  48 `--description` *description string*
  49 :   Description of the application
  50 
  51 `--help` or `-h`
  52 :   Print the usage text with a list and description of each valid
  53     option for the current platform to the output stream, and exit
  54 
  55 `--name` or `-n` *name*
  56 :   Name of the application and/or installer
  57 
  58 `--output` or `-o` *output path*
  59 :   Path where generated output file is placed
  60     (absolute path or relative to the current directory)
  61 
  62 `--temp-root` *file path*
  63 :   Path of a new or empty directory used to create temporary files
  64     (absolute path or relative to the current directory).
  65     If specified, the temp-root will not be removed upon the task
  66     completion and must be removed manually.
  67     If not specified, a temporary directory will be created and
  68     removed upon the task completion.
  69 
  70 `--vendor` *vendor string*
  71 :   Vendor of the application
  72 
  73 `--verbose`
  74 :   Enables verbose output
  75 
  76 `--version`
  77 :   Print the product version to the output stream and exit
  78 
  79 ### Options for creating the runtime image:
  80 
  81 
  82 `--add-modules` *module name* \[`,`*module name*...\]
  83 :   A comma (",") separated list of modules to add.
  84     This module list, along with the main module (if specified)
  85     will be passed to jlink as the --add-module argument.
  86     if not specified, either just the main module (if --module is
  87     specified), or the default set of modules (if --main-jar is
  88     specified) are used.
  89     This option can be used multiple times.
  90 
  91 `--module-path` or `-p` *module path*...
  92 :   A File.pathSeparator separated list of paths
  93     Each path is either a directory of modules or the path to a
  94     modular jar.
  95     (each path is absolute or relative to the current directory)
  96     This option can be used multiple times.
  97 
  98 `--runtime-image` *file path*
  99 :   Path of the predefined runtime image that will be copied into
 100     the application image
 101     (absolute path or relative to the current directory).
 102     If --runtime-image is not specified, jpackage will run jlink to
 103     create the runtime image using options:
 104     --strip-debug, --no-header-files, --no-man-pages, and
 105     --strip-native-commands.  --bind-services will also be added if
 106     --add-modules is not specified.
 107 
 108 ### Options for creating the application image:
 109 
 110 `--icon` *icon file path*
 111 :   Path of the icon of the application bundle
 112     (absolute path or relative to the current directory)
 113 
 114 `--input` or `-i` *input path*
 115 :   Path of the input directory that contains the files to be packaged
 116     (absolute path or relative to the current directory).
 117     All files in the input directory will be packaged into the
 118     application image.
 119 
 120 
 121 ### Options for creating the application launcher(s):
 122 
 123 
 124 `--add-launcher` *launcher name*=*file path*
 125 :   Name of launcher, and a path to a Properties file that contains
 126     a list of key, value pairs
 127     (absolute path or relative to the current directory)
 128     The keys "module", "add-modules", "main-jar", "main-class",
 129     "arguments", "java-options", "app-version", "icon", and
 130     "win-console" can be used.
 131     These options are added to, or used to overwrite, the original
 132     command line options to build an additional alternative launcher.
 133     The main application launcher will be built from the command line
 134     options. Additional alternative launchers can be built using
 135     this option, and this option can be used multiple times to
 136     build multiple additional launchers. 
 137 
 138 `--arguments` *main class arguments*
 139 :   Command line arguments to pass to the main class if no command
 140     line arguments are given to the launcher
 141     This option can be used multiple times.
 142 
 143 `--java-options` *java options*
 144 :   Options to pass to the Java runtime
 145     This option can be used multiple times.
 146 
 147 `--main-class` *class name*
 148 :   Qualified name of the application main class to execute
 149     This option can only be used if --main-jar is specified.
 150 
 151 `--main-jar` *main jar file*
 152 :   The main JAR of the application; containing the main class
 153     (specified as a path relative to the input path).
 154     Either --module or --main-jar option can be specified but not
 155     both.
 156 
 157 `--module` or `-m` *module name*/*main class*]
 158 :   The main module (and optionally main class) of the application
 159     This module must be located on the module path.
 160     When this option is specified, the main module will be linked
 161     in the Java runtime image.  Either --module or --main-jar
 162     option can be specified but not both.
 163 
 164 
 165 ### Platform dependent option for creating the application launcher:
 166 
 167 
 168 #### Windows platform options:
 169 
 170 `--win-console`
 171 :   Creates a console launcher for the application, should be
 172     specified for application which requires console interactions
 173 
 174 #### MacOS platform options: 
 175 
 176 `--mac-bundle-identifier` *ID string*
 177 :   An identifier that uniquely identifies the application for MacOSX.
 178     Defaults to the value of --identifier option.
 179     May only use alphanumeric (A-Z,a-z,0-9), hyphen (-),
 180     and period (.) characters.
 181 
 182 `--mac-bundle-name` *name string*
 183 :   Name of the application as it appears in the Menu Bar
 184     This can be different from the application name.
 185     This name must be less than 16 characters long and be suitable for
 186     displaying in the menu bar and the application Info window.
 187     Defaults to the application name.
 188 
 189 `--mac-bundle-signing-prefix` *prefix string*
 190 :   When signing the application bundle, this value is prefixed to all
 191     components that need to be signed that don't have
 192     an existing bundle identifier.
 193 
 194 `--mac-sign`
 195 :   Request that the bundle be signed
 196 
 197 `--mac-signing-keychain` *file path*
 198 :   Path of the keychain to search for the signing identity
 199     (absolute path or relative to the current directory).
 200     If not specified, the standard keychains are used.
 201 
 202 `--mac-signing-key-user-name` *team name*
 203 :   Team name portion in Apple signing identities' names
 204     For example "Developer ID Application: <team name>"
 205 
 206 :   User name portion of the typical
 207     "Mac Developer ID Application: <user name>" signing key
 208 
 209 
 210 ### Options for creating the application installer(s):
 211 
 212 
 213 `--app-image` *file path*
 214 :   Location of the predefined application image that is used
 215     to build an installable package
 216     (absolute path or relative to the current directory).
 217     See create-app-image mode options to create the application image.
 218 
 219 `--file-associations` *file path*
 220 :   Path to a Properties file that contains list of key, value pairs
 221     (absolute path or relative to the current directory).
 222     The keys "extension", "mime-type", "icon", and "description"
 223     can be used to describe the association.
 224     This option can be used multiple times.
 225 
 226 `--identifier` *id string*
 227 :   An identifier that uniquely identifies the application.
 228     Defaults to the main class name.
 229     The value should be a valid DNS name.
 230 
 231 `--install-dir` *file path*
 232 :   Absolute path of the installation directory of the application on OS X
 233     or Linux. Relative sub-path of the installation location of the application
 234     such as "Program Files" or "AppData" on Windows.
 235 
 236 `--installer-type` *type*
 237 :   The type of the installer to create.
 238     Valid values are: {"exe", "msi", "rpm", "deb", "pkg", "dmg"}
 239     If this option is not specified (in create-installer mode) all
 240     supported types of installable packages for the current
 241     platform will be created.
 242 
 243 `--license-file` *file path*
 244 :   Path to the license file
 245     (absolute path or relative to the current directory)
 246 
 247 `--resource-dir` *path*
 248 :   Path to override jpackage resources.
 249     Icons, template files, and other resources of jpackage can be
 250     over-ridden by adding replacement resources to this directory.
 251     (absolute path or relative to the current directory)
 252 
 253 `--runtime-image` *file-path*
 254 :   Path of the predefined runtime image to install
 255     (absolute path or relative to the current directory).
 256     Option is required when creating a runtime installer.
 257 
 258 
 259 ### Platform dependent options for creating the application installer(s):
 260 
 261 
 262 #### Windows platform options: 
 263 
 264 `--win-dir-chooser`
 265 :   Adds a dialog to enable the user to choose a directory in which
 266     the product is installed
 267 
 268 `--win-menu`
 269 :   Adds the application to the system menu
 270 
 271 `--win-menu-group` *menu group name*
 272 :   Start Menu group this application is placed in
 273 
 274 `--win-per-user-install`
 275 :   Request to perform an install on a per-user basis
 276 
 277 `--win-registry-name` *registry name*
 278 :   Name of the application for registry references.
 279     The default is the Application Name with only
 280     alphanumerics, dots, and dashes (no whitespace)
 281 
 282 `--win-shortcut`
 283 :   Creates a desktop shortcut for the application
 284 
 285 `--win-upgrade-uuid` *id string*
 286 :   UUID associated with upgrades for this package
 287 
 288 #### Linux platform options:
 289 
 290 `--linux-bundle-name` *bundle name*
 291 :   Name for Linux bundle, defaults to the application name
 292 
 293 `--linux-deb-maintainer` *email address*
 294 :   Maintainer for .deb bundle
 295 
 296 `--linux-menu-group` *menu-group-name*
 297 :   Menu group this application is placed in
 298 
 299 `--linux-package-deps`
 300 :   Required packages or capabilities for the application
 301 
 302 `--linux-rpm-license-type` *type string*
 303 :   Type of the license ("License: <value>" of the RPM .spec)
 304 
 305 
 306 ## jpackage Examples
 307 
 308 Generate a non-modular application image:
 309 ```
 310     jpackage create-app-image -o outputdir -i inputdir -n name \
 311         --main-class className --main-jar MyJar.jar
 312 ```
 313 Generate a modular application image:
 314 ```
 315     jpackage create-app-image -o outputdir -n name \
 316         -p modulePath -m moduleName/className
 317         To provide your own options to jlink, run jlink separately:
 318             jlink --output appRuntimeImage -p ModulePath -m moduleName \
 319                 --no-header-files [<additional jlink options>...]
 320             jpackage create-app-image -o outputdir -n name\
 321                 -m moduleName/className --runtime-image appRuntimeIMage
 322 ```
 323 Generate an application installer:
 324 ```
 325     jpackage create-installer -o outputdir -n name \
 326         -p modulePath -m moduleName/className
 327     jpackage create-installer -i inputdir -o outputdir -n name \
 328         --main-class package.ClassName --main-jar MyJar.jar
 329     jpackage create-installer -o outputdir -n <installer-name> \
 330         --app-image <app image dir> [--installer-type <type>]
 331 ```
 332 Generate a Java runtime installer:
 333 ```
 334     jpackage create-installer -o outputdir -n name \
 335         --runtime-image <runtime-image>
 336 ```
 337 
 338