1 .\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
   2 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3 .\"
   4 .\" This code is free software; you can redistribute it and/or modify it
   5 .\" under the terms of the GNU General Public License version 2 only, as
   6 .\" published by the Free Software Foundation.
   7 .\"
   8 .\" This code is distributed in the hope that it will be useful, but WITHOUT
   9 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11 .\" version 2 for more details (a copy is included in the LICENSE file that
  12 .\" accompanied this code).
  13 .\"
  14 .\" You should have received a copy of the GNU General Public License version
  15 .\" 2 along with this work; if not, write to the Free Software Foundation,
  16 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17 .\"
  18 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19 .\" or visit www.oracle.com if you need additional information or have any
  20 .\" questions.
  21 .\"
  22 .\" Automatically generated by Pandoc 2.3.1
  23 .\"
  24 .TH "JPACKAGE" "1" "2019" "JDK 14" "JDK Commands"
  25 .hy
  26 .SH NAME
  27 .PP
  28 jpackage \- tool for packaging self\-contained Java applications.
  29 .SH SYNOPSIS
  30 .PP
  31 \f[CB]jpackage\f[R] [\f[I]options\f[R]]
  32 .TP
  33 .B \f[I]options\f[R]
  34 Command\-line options separated by spaces.
  35 See \f[B]jpackage Options\f[R].
  36 .RS
  37 .RE
  38 .SH DESCRIPTION
  39 .PP
  40 The \f[CB]jpackage\f[R] tool will take as input a Java application and a
  41 Java run\-time image, and produce a Java application image that includes
  42 all the necessary dependencies.
  43 It will be able to produce a native package in a platform\-specific
  44 format, such as an exe on Windows or a dmg on macOS.
  45 Each format must be built on the platform it runs on, there is no
  46 cross\-platform support.
  47 The tool will have options that allow packaged applications to be
  48 customized in various ways.
  49 .SH JPACKAGE OPTIONS
  50 .SS Generic Options:
  51 .TP
  52 .B \f[CB]\@\f[R]\f[I]filename\f[R]
  53 Read options and/or mode from a file.
  54 .RS
  55 .PP
  56 This option can be used multiple times.
  57 .RE
  58 .TP
  59 .B \f[CB]\-\-type\f[R] or \f[CB]\-t\f[R] \f[I]type string\f[R]
  60 The type of package to create
  61 .RS
  62 .PP
  63 Valid values are: {"app\-image", "exe", "msi", "rpm", "deb", "pkg",
  64 "dmg"}
  65 .PP
  66 If this option is not specified a platform dependent default type will
  67 be created.
  68 .RE
  69 .TP
  70 .B \f[CB]\-\-app\-version\f[R] \f[I]version\f[R]
  71 Version of the application and/or package`
  72 .RS
  73 .RE
  74 .TP
  75 .B \f[CB]\-\-copyright\f[R] \f[I]copyright string\f[R]
  76 Copyright for the application.
  77 .RS
  78 .RE
  79 .TP
  80 .B \f[CB]\-\-description\f[R] \f[I]description string\f[R]
  81 Description of the application.
  82 .RS
  83 .RE
  84 .TP
  85 .B \f[CB]\-\-help\f[R] or \f[CB]\-h\f[R]
  86 Print the usage text with a list and description of each valid option
  87 for the current platform to the output stream, and exit.
  88 .RS
  89 .RE
  90 .TP
  91 .B \f[CB]\-\-name\f[R] or \f[CB]\-n\f[R] \f[I]name\f[R]
  92 Name of the application and/or package.
  93 .RS
  94 .RE
  95 .TP
  96 .B \f[CB]\-\-dest\f[R] or \f[CB]\-d\f[R] \f[I]output path\f[R]
  97 Path where generated output file is placed
  98 .RS
  99 .PP
 100 Defaults to the current working directory.
 101 (absolute path or relative to the current directory).
 102 .RE
 103 .TP
 104 .B \f[CB]\-\-temp\f[R] \f[I]file path\f[R]
 105 Path of a new or empty directory used to create temporary files
 106 (absolute path or relative to the current directory).
 107 .RS
 108 .PP
 109 If specified, the temp dir will not be removed upon the task completion
 110 and must be removed manually.
 111 .PP
 112 If not specified, a temporary directory will be created and removed upon
 113 the task completion.
 114 .RE
 115 .TP
 116 .B \f[CB]\-\-vendor\f[R] \f[I]vendor string\f[R]
 117 Vendor of the application.
 118 .RS
 119 .RE
 120 .TP
 121 .B \f[CB]\-\-verbose\f[R]
 122 Enables verbose output.
 123 .RS
 124 .RE
 125 .TP
 126 .B \f[CB]\-\-version\f[R]
 127 Print the product version to the output stream and exit.
 128 .RS
 129 .RE
 130 .SS Options for creating the runtime image:
 131 .TP
 132 .B \f[CB]\-\-add\-modules\f[R] \f[I]module name\f[R] [\f[CB],\f[R]\f[I]module name\f[R]...]
 133 A comma (",") separated list of modules to add.
 134 .RS
 135 .PP
 136 This module list, along with the main module (if specified) will be
 137 passed to jlink as the \-\-add\-module argument.
 138 If not specified, either just the main module (if \-\-module is
 139 specified), or the default set of modules (if \-\-main\-jar is
 140 specified) are used.
 141 .PP
 142 This option can be used multiple times.
 143 .RE
 144 .TP
 145 .B \f[CB]\-\-module\-path\f[R] or \f[CB]\-p\f[R] \f[I]module path\f[R]...
 146 A File.pathSeparator separated list of paths.
 147 .RS
 148 .PP
 149 Each path is either a directory of modules or the path to a modular jar,
 150 and is absolute or relative to the current directory.
 151 .PP
 152 This option can be used multiple times.
 153 .RE
 154 .TP
 155 .B \f[CB]\-\-bind\-services\f[R]
 156 Pass on \-\-bind\-services option to jlink (which will link in service
 157 provider modules and their dependences).
 158 .RS
 159 .RE
 160 .TP
 161 .B \f[CB]\-\-runtime\-image\f[R] \f[I]file path\f[R]
 162 Path of the predefined runtime image that will be copied into the
 163 application image (absolute path or relative to the current directory).
 164 .RS
 165 .PP
 166 If \-\-runtime\-image is not specified, jpackage will run jlink to
 167 create the runtime image using options: \-\-strip\-debug,
 168 \-\-no\-header\-files, \-\-no\-man\-pages, and
 169 \-\-strip\-native\-commands.
 170 .RE
 171 .SS Options for creating the application image:
 172 .TP
 173 .B \f[CB]\-\-icon\f[R] \f[I]icon file path\f[R]
 174 Path of the icon of the application bundle (absolute path or relative to
 175 the current directory).
 176 .RS
 177 .RE
 178 .TP
 179 .B \f[CB]\-\-input\f[R] or \f[CB]\-i\f[R] \f[I]input path\f[R]
 180 Path of the input directory that contains the files to be packaged
 181 (absolute path or relative to the current directory).
 182 .RS
 183 .PP
 184 All files in the input directory will be packaged into the application
 185 image.
 186 .RE
 187 .SS Options for creating the application launcher(s):
 188 .TP
 189 .B \f[CB]\-\-add\-launcher\f[R] \f[I]launcher name\f[R]=\f[I]file path\f[R]
 190 Name of launcher, and a path to a Properties file that contains a list
 191 of key, value pairs (absolute path or relative to the current
 192 directory).
 193 .RS
 194 .PP
 195 The keys "module", "add\-modules", "main\-jar", "main\-class",
 196 "arguments", "java\-options", "app\-version", "icon", and "win\-console"
 197 can be used.
 198 .PP
 199 These options are added to, or used to overwrite, the original command
 200 line options to build an additional alternative launcher.
 201 The main application launcher will be built from the command line
 202 options.
 203 Additional alternative launchers can be built using this option, and
 204 this option can be used multiple times to build multiple additional
 205 launchers.
 206 .RE
 207 .TP
 208 .B \f[CB]\-\-arguments\f[R] \f[I]main class arguments\f[R]
 209 Command line arguments to pass to the main class if no command line
 210 arguments are given to the launcher.
 211 .RS
 212 .PP
 213 This option can be used multiple times.
 214 .RE
 215 .TP
 216 .B \f[CB]\-\-java\-options\f[R] \f[I]java options\f[R]
 217 Options to pass to the Java runtime.
 218 .RS
 219 .PP
 220 This option can be used multiple times.
 221 .RE
 222 .TP
 223 .B \f[CB]\-\-main\-class\f[R] \f[I]class name\f[R]
 224 Qualified name of the application main class to execute.
 225 .RS
 226 .PP
 227 This option can only be used if \-\-main\-jar is specified.
 228 .RE
 229 .TP
 230 .B \f[CB]\-\-main\-jar\f[R] \f[I]main jar file\f[R]
 231 The main JAR of the application; containing the main class (specified as
 232 a path relative to the input path).
 233 .RS
 234 .PP
 235 Either \-\-module or \-\-main\-jar option can be specified but not both.
 236 .RE
 237 .TP
 238 .B \f[CB]\-\-module\f[R] or \f[CB]\-m\f[R] \f[I]module name\f[R]/\f[I]main class\f[R]]
 239 The main module (and optionally main class) of the application This
 240 module must be located on the module path.
 241 .RS
 242 .PP
 243 When this option is specified, the main module will be linked in the
 244 Java runtime image.
 245 Either \-\-module or \-\-main\-jar option can be specified but not both.
 246 .RE
 247 .SS Platform dependent option for creating the application launcher:
 248 .SS Windows platform options (available only when running on Windows):
 249 .TP
 250 .B \f[CB]\-\-win\-console\f[R]
 251 Creates a console launcher for the application, should be specified for
 252 application which requires console interactions
 253 .RS
 254 .RE
 255 .SS macOS platform options (available only when running on macOS):
 256 .TP
 257 .B \f[CB]\-\-mac\-package\-identifier\f[R] \f[I]ID string\f[R]
 258 An identifier that uniquely identifies the application for macOSX.
 259 .RS
 260 .PP
 261 Defaults to the the main class name.
 262 .PP
 263 May only use alphanumeric (A\-Z,a\-z,0\-9), hyphen (\-), and period (.)
 264 characters.
 265 .RE
 266 .TP
 267 .B \f[CB]\-\-mac\-package\-name\f[R] \f[I]name string\f[R]
 268 Name of the application as it appears in the Menu Bar.
 269 .RS
 270 .PP
 271 This can be different from the application name.
 272 .PP
 273 This name must be less than 16 characters long and be suitable for
 274 displaying in the menu bar and the application Info window.
 275 Defaults to the application name.
 276 .RE
 277 .TP
 278 .B \f[CB]\-\-mac\-bundle\-signing\-prefix\f[R] \f[I]prefix string\f[R]
 279 When signing the application bundle, this value is prefixed to all
 280 components that need to be signed that don\[aq]t have an existing bundle
 281 identifier.
 282 .RS
 283 .RE
 284 .TP
 285 .B \f[CB]\-\-mac\-sign\f[R]
 286 Request that the bundle be signed.
 287 .RS
 288 .RE
 289 .TP
 290 .B \f[CB]\-\-mac\-signing\-keychain\f[R] \f[I]file path\f[R]
 291 Path of the keychain to search for the signing identity (absolute path
 292 or relative to the current directory).
 293 .RS
 294 .PP
 295 If not specified, the standard keychains are used.
 296 .RE
 297 .TP
 298 .B \f[CB]\-\-mac\-signing\-key\-user\-name\f[R] \f[I]team name\f[R]
 299 Team name portion in Apple signing identities\[aq] names.
 300 .RS
 301 .PP
 302 For example "Developer ID Application: "
 303 .RE
 304 .SS Options for creating the application package:
 305 .TP
 306 .B \f[CB]\-\-app\-image\f[R] \f[I]file path\f[R]
 307 Location of the predefined application image that is used to build an
 308 installable package (absolute path or relative to the current
 309 directory).
 310 .RS
 311 .PP
 312 See create\-app\-image mode options to create the application image.
 313 .RE
 314 .TP
 315 .B \f[CB]\-\-file\-associations\f[R] \f[I]file path\f[R]
 316 Path to a Properties file that contains list of key, value pairs
 317 (absolute path or relative to the current directory).
 318 .RS
 319 .PP
 320 The keys "extension", "mime\-type", "icon", and "description" can be
 321 used to describe the association.
 322 .PP
 323 This option can be used multiple times.
 324 .RE
 325 .TP
 326 .B \f[CB]\-\-install\-dir\f[R] \f[I]file path\f[R]
 327 Absolute path of the installation directory of the application on OS X
 328 or Linux.
 329 Relative sub\-path of the installation location of the application such
 330 as "Program Files" or "AppData" on Windows.
 331 .RS
 332 .RE
 333 .TP
 334 .B \f[CB]\-\-license\-file\f[R] \f[I]file path\f[R]
 335 Path to the license file (absolute path or relative to the current
 336 directory).
 337 .RS
 338 .RE
 339 .TP
 340 .B \f[CB]\-\-resource\-dir\f[R] \f[I]path\f[R]
 341 Path to override jpackage resources (absolute path or relative to the
 342 current directory).
 343 .RS
 344 .PP
 345 Icons, template files, and other resources of jpackage can be
 346 over\-ridden by adding replacement resources to this directory.
 347 .RE
 348 .TP
 349 .B \f[CB]\-\-runtime\-image\f[R] \f[I]file\-path\f[R]
 350 Path of the predefined runtime image to install (absolute path or
 351 relative to the current directory).
 352 .RS
 353 .PP
 354 Option is required when creating a runtime installer.
 355 .RE
 356 .SS Platform dependent options for creating the application package:
 357 .SS Windows platform options (available only when running on Windows):
 358 .TP
 359 .B \f[CB]\-\-win\-dir\-chooser\f[R]
 360 Adds a dialog to enable the user to choose a directory in which the
 361 product is installed.
 362 .RS
 363 .RE
 364 .TP
 365 .B \f[CB]\-\-win\-menu\f[R]
 366 Adds the application to the system menu.
 367 .RS
 368 .RE
 369 .TP
 370 .B \f[CB]\-\-win\-menu\-group\f[R] \f[I]menu group name\f[R]
 371 Start Menu group this application is placed in.
 372 .RS
 373 .RE
 374 .TP
 375 .B \f[CB]\-\-win\-per\-user\-install\f[R]
 376 Request to perform an install on a per\-user basis.
 377 .RS
 378 .RE
 379 .TP
 380 .B \f[CB]\-\-win\-shortcut\f[R]
 381 Creates a desktop shortcut for the application.
 382 .RS
 383 .RE
 384 .TP
 385 .B \f[CB]\-\-win\-upgrade\-uuid\f[R] \f[I]id string\f[R]
 386 UUID associated with upgrades for this package.
 387 .RS
 388 .RE
 389 .SS Linux platform options (available only when running on Linux):
 390 .TP
 391 .B \f[CB]\-\-linux\-package\-name\f[R] \f[I]package name\f[R]
 392 Name for Linux package, defaults to the application name.
 393 .RS
 394 .RE
 395 .TP
 396 .B \f[CB]\-\-linux\-deb\-maintainer\f[R] \f[I]email address\f[R]
 397 Maintainer for .deb bundle.
 398 .RS
 399 .RE
 400 .TP
 401 .B \f[CB]\-\-linux\-menu\-group\f[R] \f[I]menu\-group\-name\f[R]
 402 Menu group this application is placed in.
 403 .RS
 404 .RE
 405 .TP
 406 .B \f[CB]\-\-linux\-package\-deps\f[R]
 407 Required packages or capabilities for the application
 408 .RS
 409 .RE
 410 .TP
 411 .B \f[CB]\-\-linux\-rpm\-license\-type\f[R] \f[I]type string\f[R]
 412 Type of the license ("License: " of the RPM .spec).
 413 .RS
 414 .RE
 415 .TP
 416 .B \f[CB]\-\-linux\-app\-release\f[R] \f[I]release string\f[R]
 417 Release value of the RPM .spec file or Debian revision value of the DEB
 418 control file.
 419 .RS
 420 .RE
 421 .TP
 422 .B \f[CB]\-\-linux\-app\-category\f[R] \f[I]category string\f[R]
 423 Group value of the RPM .spec file or Section value of DEB control file.
 424 .RS
 425 .RE
 426 .TP
 427 .B \f[CB]\-\-linux\-shortcut\f[R]
 428 Creates a shortcut for the application
 429 .RS
 430 .RE
 431 .SH JPACKAGE EXAMPLES
 432 .IP
 433 .nf
 434 \f[CB]
 435 Generate\ an\ application\ package\ suitable\ for\ the\ host\ system:
 436 \f[R]
 437 .fi
 438 .IP
 439 .nf
 440 \f[CB]
 441 For\ a\ modular\ application:
 442 \ \ \ \ jpackage\ \-n\ name\ \-p\ modulePath\ \-m\ moduleName/className
 443 For\ a\ non\-modular\ application:
 444 \ \ \ \ jpackage\ \-i\ inputDir\ \-n\ name\ \\
 445 \ \ \ \ \ \ \ \ \-\-main\-class\ className\ \-\-main\-jar\ myJar.jar
 446 From\ a\ pre\-built\ application\ image:
 447 \ \ \ \ jpackage\ \-n\ name\ \-\-app\-image\ appImageDir
 448 \f[R]
 449 .fi
 450 .IP
 451 .nf
 452 \f[CB]
 453 Generate\ an\ application\ image:
 454 \f[R]
 455 .fi
 456 .IP
 457 .nf
 458 \f[CB]
 459 For\ a\ modular\ application:
 460 \ \ \ \ jpackage\ \-\-type\ app\-image\ \-n\ name\ \-p\ modulePath\ \\
 461 \ \ \ \ \ \ \ \ \-m\ moduleName/className
 462 For\ a\ non\-modular\ application:
 463 \ \ \ \ jpackage\ \-\-type\ app\-image\ \-i\ inputDir\ \-n\ name\ \\
 464 \ \ \ \ \ \ \ \ \-\-main\-class\ className\ \-\-main\-jar\ myJar.jar
 465 To\ provide\ your\ own\ options\ to\ jlink,\ run\ jlink\ separately:
 466 \ \ \ \ jlink\ \-\-output\ appRuntimeImage\ \-p\ modulePath\ \-m\ moduleName\ \\
 467 \ \ \ \ \ \ \ \ \-\-no\-header\-files\ [<additional\ jlink\ options>...]
 468 \ \ \ \ jpackage\ \-\-type\ app\-image\ \-n\ name\ \\
 469 \ \ \ \ \ \ \ \ \-m\ moduleName/className\ \-\-runtime\-image\ appRuntimeImage
 470 \f[R]
 471 .fi
 472 .IP
 473 .nf
 474 \f[CB]
 475 Generate\ a\ Java\ runtime\ package:
 476 \f[R]
 477 .fi
 478 .IP
 479 .nf
 480 \f[CB]
 481 jpackage\ \-n\ name\ \-\-runtime\-image\ <runtime\-image>
 482 \f[R]
 483 .fi