484 lines
14 KiB
Groff
484 lines
14 KiB
Groff
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
.\"
|
|
.\" This code is free software; you can redistribute it and/or modify it
|
|
.\" under the terms of the GNU General Public License version 2 only, as
|
|
.\" published by the Free Software Foundation.
|
|
.\"
|
|
.\" This code is distributed in the hope that it will be useful, but WITHOUT
|
|
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
.\" version 2 for more details (a copy is included in the LICENSE file that
|
|
.\" accompanied this code).
|
|
.\"
|
|
.\" You should have received a copy of the GNU General Public License version
|
|
.\" 2 along with this work; if not, write to the Free Software Foundation,
|
|
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
.\"
|
|
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
.\" or visit www.oracle.com if you need additional information or have any
|
|
.\" questions.
|
|
.\"
|
|
.\" Automatically generated by Pandoc 2.3.1
|
|
.\"
|
|
.TH "JPACKAGE" "1" "2019" "JDK 14" "JDK Commands"
|
|
.hy
|
|
.SH NAME
|
|
.PP
|
|
jpackage \- tool for packaging self\-contained Java applications.
|
|
.SH SYNOPSIS
|
|
.PP
|
|
\f[CB]jpackage\f[R] [\f[I]options\f[R]]
|
|
.TP
|
|
.B \f[I]options\f[R]
|
|
Command\-line options separated by spaces.
|
|
See \f[B]jpackage Options\f[R].
|
|
.RS
|
|
.RE
|
|
.SH DESCRIPTION
|
|
.PP
|
|
The \f[CB]jpackage\f[R] 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 be able to produce a native package in a platform\-specific
|
|
format, such as an exe on Windows or a dmg on macOS.
|
|
Each format must be built on the platform it runs on, there is no
|
|
cross\-platform support.
|
|
The tool will have options that allow packaged applications to be
|
|
customized in various ways.
|
|
.SH JPACKAGE OPTIONS
|
|
.SS Generic Options:
|
|
.TP
|
|
.B \f[CB]\@\f[R]\f[I]filename\f[R]
|
|
Read options and/or mode from a file.
|
|
.RS
|
|
.PP
|
|
This option can be used multiple times.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-type\f[R] or \f[CB]\-t\f[R] \f[I]type string\f[R]
|
|
The type of package to create
|
|
.RS
|
|
.PP
|
|
Valid values are: {"app\-image", "exe", "msi", "rpm", "deb", "pkg",
|
|
"dmg"}
|
|
.PP
|
|
If this option is not specified a platform dependent default type will
|
|
be created.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-app\-version\f[R] \f[I]version\f[R]
|
|
Version of the application and/or package`
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-copyright\f[R] \f[I]copyright string\f[R]
|
|
Copyright for the application.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-description\f[R] \f[I]description string\f[R]
|
|
Description of the application.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-help\f[R] or \f[CB]\-h\f[R]
|
|
Print the usage text with a list and description of each valid option
|
|
for the current platform to the output stream, and exit.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-name\f[R] or \f[CB]\-n\f[R] \f[I]name\f[R]
|
|
Name of the application and/or package.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-dest\f[R] or \f[CB]\-d\f[R] \f[I]output path\f[R]
|
|
Path where generated output file is placed
|
|
.RS
|
|
.PP
|
|
Defaults to the current working directory.
|
|
(absolute path or relative to the current directory).
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-temp\f[R] \f[I]file path\f[R]
|
|
Path of a new or empty directory used to create temporary files
|
|
(absolute path or relative to the current directory).
|
|
.RS
|
|
.PP
|
|
If specified, the temp dir will not be removed upon the task completion
|
|
and must be removed manually.
|
|
.PP
|
|
If not specified, a temporary directory will be created and removed upon
|
|
the task completion.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-vendor\f[R] \f[I]vendor string\f[R]
|
|
Vendor of the application.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-verbose\f[R]
|
|
Enables verbose output.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-version\f[R]
|
|
Print the product version to the output stream and exit.
|
|
.RS
|
|
.RE
|
|
.SS Options for creating the runtime image:
|
|
.TP
|
|
.B \f[CB]\-\-add\-modules\f[R] \f[I]module name\f[R] [\f[CB],\f[R]\f[I]module name\f[R]...]
|
|
A comma (",") separated list of modules to add.
|
|
.RS
|
|
.PP
|
|
This module list, along with the main module (if specified) will be
|
|
passed to jlink as the \-\-add\-module argument.
|
|
If not specified, either just the main module (if \-\-module is
|
|
specified), or the default set of modules (if \-\-main\-jar is
|
|
specified) are used.
|
|
.PP
|
|
This option can be used multiple times.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-module\-path\f[R] or \f[CB]\-p\f[R] \f[I]module path\f[R]...
|
|
A File.pathSeparator separated list of paths.
|
|
.RS
|
|
.PP
|
|
Each path is either a directory of modules or the path to a modular jar,
|
|
and is absolute or relative to the current directory.
|
|
.PP
|
|
This option can be used multiple times.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-bind\-services\f[R]
|
|
Pass on \-\-bind\-services option to jlink (which will link in service
|
|
provider modules and their dependences).
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-runtime\-image\f[R] \f[I]file path\f[R]
|
|
Path of the predefined runtime image that will be copied into the
|
|
application image (absolute path or relative to the current directory).
|
|
.RS
|
|
.PP
|
|
If \-\-runtime\-image is not specified, jpackage will run jlink to
|
|
create the runtime image using options: \-\-strip\-debug,
|
|
\-\-no\-header\-files, \-\-no\-man\-pages, and
|
|
\-\-strip\-native\-commands.
|
|
.RE
|
|
.SS Options for creating the application image:
|
|
.TP
|
|
.B \f[CB]\-\-icon\f[R] \f[I]icon file path\f[R]
|
|
Path of the icon of the application bundle (absolute path or relative to
|
|
the current directory).
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-input\f[R] or \f[CB]\-i\f[R] \f[I]input path\f[R]
|
|
Path of the input directory that contains the files to be packaged
|
|
(absolute path or relative to the current directory).
|
|
.RS
|
|
.PP
|
|
All files in the input directory will be packaged into the application
|
|
image.
|
|
.RE
|
|
.SS Options for creating the application launcher(s):
|
|
.TP
|
|
.B \f[CB]\-\-add\-launcher\f[R] \f[I]launcher name\f[R]=\f[I]file path\f[R]
|
|
Name of launcher, and a path to a Properties file that contains a list
|
|
of key, value pairs (absolute path or relative to the current
|
|
directory).
|
|
.RS
|
|
.PP
|
|
The keys "module", "add\-modules", "main\-jar", "main\-class",
|
|
"arguments", "java\-options", "app\-version", "icon", and "win\-console"
|
|
can be used.
|
|
.PP
|
|
These options are added to, or used to overwrite, the original command
|
|
line options to build an additional alternative launcher.
|
|
The main application launcher will be built from the command line
|
|
options.
|
|
Additional alternative launchers can be built using this option, and
|
|
this option can be used multiple times to build multiple additional
|
|
launchers.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-arguments\f[R] \f[I]main class arguments\f[R]
|
|
Command line arguments to pass to the main class if no command line
|
|
arguments are given to the launcher.
|
|
.RS
|
|
.PP
|
|
This option can be used multiple times.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-java\-options\f[R] \f[I]java options\f[R]
|
|
Options to pass to the Java runtime.
|
|
.RS
|
|
.PP
|
|
This option can be used multiple times.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-main\-class\f[R] \f[I]class name\f[R]
|
|
Qualified name of the application main class to execute.
|
|
.RS
|
|
.PP
|
|
This option can only be used if \-\-main\-jar is specified.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-main\-jar\f[R] \f[I]main jar file\f[R]
|
|
The main JAR of the application; containing the main class (specified as
|
|
a path relative to the input path).
|
|
.RS
|
|
.PP
|
|
Either \-\-module or \-\-main\-jar option can be specified but not both.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-module\f[R] or \f[CB]\-m\f[R] \f[I]module name\f[R]/\f[I]main class\f[R]]
|
|
The main module (and optionally main class) of the application This
|
|
module must be located on the module path.
|
|
.RS
|
|
.PP
|
|
When this option is specified, the main module will be linked in the
|
|
Java runtime image.
|
|
Either \-\-module or \-\-main\-jar option can be specified but not both.
|
|
.RE
|
|
.SS Platform dependent option for creating the application launcher:
|
|
.SS Windows platform options (available only when running on Windows):
|
|
.TP
|
|
.B \f[CB]\-\-win\-console\f[R]
|
|
Creates a console launcher for the application, should be specified for
|
|
application which requires console interactions
|
|
.RS
|
|
.RE
|
|
.SS macOS platform options (available only when running on macOS):
|
|
.TP
|
|
.B \f[CB]\-\-mac\-package\-identifier\f[R] \f[I]ID string\f[R]
|
|
An identifier that uniquely identifies the application for macOSX.
|
|
.RS
|
|
.PP
|
|
Defaults to the the main class name.
|
|
.PP
|
|
May only use alphanumeric (A\-Z,a\-z,0\-9), hyphen (\-), and period (.)
|
|
characters.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-mac\-package\-name\f[R] \f[I]name string\f[R]
|
|
Name of the application as it appears in the Menu Bar.
|
|
.RS
|
|
.PP
|
|
This can be different from the application name.
|
|
.PP
|
|
This name must be less than 16 characters long and be suitable for
|
|
displaying in the menu bar and the application Info window.
|
|
Defaults to the application name.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-mac\-bundle\-signing\-prefix\f[R] \f[I]prefix string\f[R]
|
|
When signing the application bundle, this value is prefixed to all
|
|
components that need to be signed that don\[aq]t have an existing bundle
|
|
identifier.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-mac\-sign\f[R]
|
|
Request that the bundle be signed.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-mac\-signing\-keychain\f[R] \f[I]file path\f[R]
|
|
Path of the keychain to search for the signing identity (absolute path
|
|
or relative to the current directory).
|
|
.RS
|
|
.PP
|
|
If not specified, the standard keychains are used.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-mac\-signing\-key\-user\-name\f[R] \f[I]team name\f[R]
|
|
Team name portion in Apple signing identities\[aq] names.
|
|
.RS
|
|
.PP
|
|
For example "Developer ID Application: "
|
|
.RE
|
|
.SS Options for creating the application package:
|
|
.TP
|
|
.B \f[CB]\-\-app\-image\f[R] \f[I]file path\f[R]
|
|
Location of the predefined application image that is used to build an
|
|
installable package (absolute path or relative to the current
|
|
directory).
|
|
.RS
|
|
.PP
|
|
See create\-app\-image mode options to create the application image.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-file\-associations\f[R] \f[I]file path\f[R]
|
|
Path to a Properties file that contains list of key, value pairs
|
|
(absolute path or relative to the current directory).
|
|
.RS
|
|
.PP
|
|
The keys "extension", "mime\-type", "icon", and "description" can be
|
|
used to describe the association.
|
|
.PP
|
|
This option can be used multiple times.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-install\-dir\f[R] \f[I]file path\f[R]
|
|
Absolute path of the installation directory of the application on OS X
|
|
or Linux.
|
|
Relative sub\-path of the installation location of the application such
|
|
as "Program Files" or "AppData" on Windows.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-license\-file\f[R] \f[I]file path\f[R]
|
|
Path to the license file (absolute path or relative to the current
|
|
directory).
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-resource\-dir\f[R] \f[I]path\f[R]
|
|
Path to override jpackage resources (absolute path or relative to the
|
|
current directory).
|
|
.RS
|
|
.PP
|
|
Icons, template files, and other resources of jpackage can be
|
|
over\-ridden by adding replacement resources to this directory.
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-runtime\-image\f[R] \f[I]file\-path\f[R]
|
|
Path of the predefined runtime image to install (absolute path or
|
|
relative to the current directory).
|
|
.RS
|
|
.PP
|
|
Option is required when creating a runtime installer.
|
|
.RE
|
|
.SS Platform dependent options for creating the application package:
|
|
.SS Windows platform options (available only when running on Windows):
|
|
.TP
|
|
.B \f[CB]\-\-win\-dir\-chooser\f[R]
|
|
Adds a dialog to enable the user to choose a directory in which the
|
|
product is installed.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-win\-menu\f[R]
|
|
Adds the application to the system menu.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-win\-menu\-group\f[R] \f[I]menu group name\f[R]
|
|
Start Menu group this application is placed in.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-win\-per\-user\-install\f[R]
|
|
Request to perform an install on a per\-user basis.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-win\-shortcut\f[R]
|
|
Creates a desktop shortcut for the application.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-win\-upgrade\-uuid\f[R] \f[I]id string\f[R]
|
|
UUID associated with upgrades for this package.
|
|
.RS
|
|
.RE
|
|
.SS Linux platform options (available only when running on Linux):
|
|
.TP
|
|
.B \f[CB]\-\-linux\-package\-name\f[R] \f[I]package name\f[R]
|
|
Name for Linux package, defaults to the application name.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-linux\-deb\-maintainer\f[R] \f[I]email address\f[R]
|
|
Maintainer for .deb bundle.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-linux\-menu\-group\f[R] \f[I]menu\-group\-name\f[R]
|
|
Menu group this application is placed in.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-linux\-package\-deps\f[R]
|
|
Required packages or capabilities for the application
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-linux\-rpm\-license\-type\f[R] \f[I]type string\f[R]
|
|
Type of the license ("License: " of the RPM .spec).
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-linux\-app\-release\f[R] \f[I]release string\f[R]
|
|
Release value of the RPM .spec file or Debian revision value of the DEB
|
|
control file.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-linux\-app\-category\f[R] \f[I]category string\f[R]
|
|
Group value of the RPM .spec file or Section value of DEB control file.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.B \f[CB]\-\-linux\-shortcut\f[R]
|
|
Creates a shortcut for the application
|
|
.RS
|
|
.RE
|
|
.SH JPACKAGE EXAMPLES
|
|
.IP
|
|
.nf
|
|
\f[CB]
|
|
Generate\ an\ application\ package\ suitable\ for\ the\ host\ system:
|
|
\f[R]
|
|
.fi
|
|
.IP
|
|
.nf
|
|
\f[CB]
|
|
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
|
|
\f[R]
|
|
.fi
|
|
.IP
|
|
.nf
|
|
\f[CB]
|
|
Generate\ an\ application\ image:
|
|
\f[R]
|
|
.fi
|
|
.IP
|
|
.nf
|
|
\f[CB]
|
|
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
|
|
\f[R]
|
|
.fi
|
|
.IP
|
|
.nf
|
|
\f[CB]
|
|
Generate\ a\ Java\ runtime\ package:
|
|
\f[R]
|
|
.fi
|
|
.IP
|
|
.nf
|
|
\f[CB]
|
|
jpackage\ \-n\ name\ \-\-runtime\-image\ <runtime\-image>
|
|
\f[R]
|
|
.fi
|