src/jdk.jartool/share/man/jar.1
author darcy
Tue, 12 Nov 2019 10:45:23 -0800
changeset 59037 3d2575331a41
parent 55140 d4890c3721be
permissions -rw-r--r--
8233940: Preview API tests for String methods should use ${jdk.version} as -source arg Reviewed-by: jlaskey, jlahoda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
     1
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     2
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     3
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     4
.\" This code is free software; you can redistribute it and/or modify it
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     5
.\" under the terms of the GNU General Public License version 2 only, as
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     6
.\" published by the Free Software Foundation.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     7
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     8
.\" This code is distributed in the hope that it will be useful, but WITHOUT
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     9
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    10
.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    11
.\" version 2 for more details (a copy is included in the LICENSE file that
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    12
.\" accompanied this code).
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    13
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    14
.\" You should have received a copy of the GNU General Public License version
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    15
.\" 2 along with this work; if not, write to the Free Software Foundation,
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    16
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    17
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    18
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    19
.\" or visit www.oracle.com if you need additional information or have any
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    20
.\" questions.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    21
.\"
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    22
.\" Automatically generated by Pandoc 2.3.1
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
    23
.\"
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    24
.TH "JAR" "1" "2018" "JDK 13" "JDK Commands"
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    25
.hy
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    26
.SH NAME
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    27
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    28
jar \- create an archive for classes and resources, and manipulate or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    29
restore individual classes or resources from an archive
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    30
.SH SYNOPSIS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    31
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    32
\f[CB]jar\f[R] [\f[I]OPTION\f[R] ...] [ [\f[CB]\-\-release\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    33
\f[I]VERSION\f[R]] [\f[CB]\-C\f[R] \f[I]dir\f[R]] \f[I]files\f[R]] ...
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    34
.SH DESCRIPTION
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    35
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    36
The \f[CB]jar\f[R] command is a general\-purpose archiving and compression
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    37
tool, based on the ZIP and ZLIB compression formats.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    38
Initially, the \f[CB]jar\f[R] command was designed to package Java applets
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    39
(not supported since JDK 11) or applications; however, beginning with
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    40
JDK 9, users can use the \f[CB]jar\f[R] command to create modular JARs.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    41
For transportation and deployment, it\[aq]s usually more convenient to
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    42
package modules as modular JARs.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    43
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    44
The syntax for the \f[CB]jar\f[R] command resembles the syntax for the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    45
\f[CB]tar\f[R] command.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    46
It has several main operation modes, defined by one of the mandatory
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    47
operation arguments.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    48
Other arguments are either options that modify the behavior of the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    49
operation or are required to perform the operation.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    50
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    51
When modules or the components of an application (files, images and
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    52
sounds) are combined into a single archive, they can be downloaded by a
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    53
Java agent (such as a browser) in a single HTTP transaction, rather than
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    54
requiring a new connection for each piece.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    55
This dramatically improves download times.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    56
The \f[CB]jar\f[R] command also compresses files, which further improves
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    57
download time.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    58
The \f[CB]jar\f[R] command also enables individual entries in a file to be
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    59
signed so that their origin can be authenticated.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    60
A JAR file can be used as a class path entry, whether or not it\[aq]s
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    61
compressed.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    62
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    63
An archive becomes a modular JAR when you include a module descriptor,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    64
\f[CB]module\-info.class\f[R], in the root of the given directories or in
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    65
the root of the \f[CB]\&.jar\f[R] archive.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    66
The following operations described in \f[B]Operation Modifiers Valid
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    67
Only in Create and Update Modes\f[R] are valid only when creating or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    68
updating a modular jar or updating an existing non\-modular jar:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    69
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    70
\f[CB]\-\-module\-version\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    71
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    72
\f[CB]\-\-hash\-modules\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    73
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    74
\f[CB]\-\-module\-path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    75
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    76
\f[B]Note:\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    77
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    78
All mandatory or optional arguments for long options are also mandatory
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    79
or optional for any corresponding short options.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    80
.SH MAIN OPERATION MODES
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    81
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    82
When using the \f[CB]jar\f[R] command, you must specify the operation for
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    83
it to perform.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    84
You specify the operation mode for the \f[CB]jar\f[R] command by including
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    85
the appropriate operation arguments described in this section.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    86
You can mix an operation argument with other one\-letter options.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    87
Generally the operation argument is the first argument specified on the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    88
command line.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    89
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    90
.B \f[CB]\-c\f[R] or \f[CB]\-\-create\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    91
Creates the archive.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    92
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    93
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    94
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    95
.B \f[CB]\-i=\f[R]\f[I]FILE\f[R] or \f[CB]\-\-generate\-index=\f[R]\f[I]FILE\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    96
Generates index information for the specified JAR file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    97
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    98
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
    99
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   100
.B \f[CB]\-t\f[R] or \f[CB]\-\-list\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   101
Lists the table of contents for the archive.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   102
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   103
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   104
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   105
.B \f[CB]\-u\f[R] or \f[CB]\-\-update\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   106
Updates an existing JAR file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   107
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   108
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   109
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   110
.B \f[CB]\-x\f[R] or \f[CB]\-\-extract\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   111
Extracts the named (or all) files from the archive.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   112
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   113
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   114
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   115
.B \f[CB]\-d\f[R] or \f[CB]\-\-describe\-module\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   116
Prints the module descriptor or automatic module name.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   117
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   118
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   119
.SH OPERATION MODIFIERS VALID IN ANY MODE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   120
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   121
You can use the following options to customize the actions of any
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   122
operation mode included in the \f[CB]jar\f[R] command.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   123
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   124
.B \f[CB]\-C\f[R] \f[I]DIR\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   125
Changes the specified directory and includes the \f[I]files\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   126
specified at the end of the command line.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   127
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   128
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   129
\f[CB]jar\f[R] [\f[I]OPTION\f[R] ...] [ [\f[CB]\-\-release\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   130
\f[I]VERSION\f[R]] [\f[CB]\-C\f[R] \f[I]dir\f[R]] \f[I]files\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   131
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   132
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   133
.B \f[CB]\-f=\f[R]\f[I]FILE\f[R] or \f[CB]\-\-file=\f[R]\f[I]FILE\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   134
Specifies the archive file name.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   135
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   136
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   137
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   138
.B \f[CB]\-\-release\f[R] \f[I]VERSION\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   139
Creates a multirelease JAR file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   140
Places all files specified after the option into a versioned directory
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   141
of the JAR file named
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   142
\f[CB]META\-INF/versions/\f[R]\f[I]VERSION\f[R]\f[CB]/\f[R], where
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   143
\f[I]VERSION\f[R] must be must be a positive integer whose value is 9 or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   144
greater.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   145
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   146
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   147
At run time, where more than one version of a class exists in the JAR,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   148
the JDK will use the first one it finds, searching initially in the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   149
directory tree whose \f[I]VERSION\f[R] number matches the JDK\[aq]s major
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   150
version number.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   151
It will then look in directories with successively lower
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   152
\f[I]VERSION\f[R] numbers, and finally look in the root of the JAR.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   153
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   154
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   155
.B \f[CB]\-v\f[R] or \f[CB]\-\-verbose\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   156
Sends or prints verbose output to standard output.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   157
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   158
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   159
.SH OPERATION MODIFIERS VALID ONLY IN CREATE AND UPDATE MODES
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   160
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   161
You can use the following options to customize the actions of the create
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   162
and the update main operation modes:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   163
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   164
.B \f[CB]\-e=\f[R]\f[I]CLASSNAME\f[R] or \f[CB]\-\-main\-class=\f[R]\f[I]CLASSNAME\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   165
Specifies the application entry point for standalone applications
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   166
bundled into a modular or executable modular JAR file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   167
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   168
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   169
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   170
.B \f[CB]\-m=\f[R]\f[I]FILE\f[R] or \f[CB]\-\-manifest=\f[R]\f[I]FILE\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   171
Includes the manifest information from the given manifest file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   172
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   173
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   174
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   175
.B \f[CB]\-M\f[R] or \f[CB]\-\-no\-manifest\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   176
Doesn\[aq]t create a manifest file for the entries.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   177
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   178
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   179
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   180
.B \f[CB]\-\-module\-version=\f[R]\f[I]VERSION\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   181
Specifies the module version, when creating or updating a modular JAR
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   182
file, or updating a non\-modular JAR file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   183
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   184
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   185
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   186
.B \f[CB]\-\-hash\-modules=\f[R]\f[I]PATTERN\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   187
Computes and records the hashes of modules matched by the given pattern
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   188
and that depend upon directly or indirectly on a modular JAR file being
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   189
created or a non\-modular JAR file being updated.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   190
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   191
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   192
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   193
.B \f[CB]\-p\f[R] or \f[CB]\-\-module\-path\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   194
Specifies the location of module dependence for generating the hash.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   195
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   196
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   197
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   198
.B \f[CB]\@\f[R]\f[I]file\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   199
Reads \f[CB]jar\f[R] options and file names from a text file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   200
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   201
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   202
.SH OPERATION MODIFIERS VALID ONLY IN CREATE, UPDATE, AND
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   203
GENERATE\-INDEX MODES
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   204
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   205
You can use the following options to customize the actions of the create
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   206
(\f[CB]\-c\f[R] or \f[CB]\-\-create\f[R]) the update (\f[CB]\-u\f[R] or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   207
\f[CB]\-\-update\f[R] ) and the generate\-index (\f[CB]\-i\f[R] or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   208
\f[CB]\-\-generate\-index=\f[R]\f[I]FILE\f[R]) main operation modes:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   209
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   210
.B \f[CB]\-0\f[R] or \f[CB]\-\-no\-compress\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   211
Stores without using ZIP compression.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   212
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   213
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   214
.SH OTHER OPTIONS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   215
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   216
The following options are recognized by the \f[CB]jar\f[R] command and not
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   217
used with operation modes:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   218
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   219
.B \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R][\f[CB]:compat\f[R]]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   220
Displays the command\-line help for the \f[CB]jar\f[R] command or
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   221
optionally the compatibility help.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   222
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   223
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   224
.TP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   225
.B \f[CB]\-\-help\-extra\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   226
Displays help on extra options.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   227
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   228
.RE
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   229
.TP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   230
.B \f[CB]\-\-version\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   231
Prints the program version.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   232
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   233
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   234
.SH EXAMPLES OF JAR COMMAND SYNTAX
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   235
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   236
Create an archive, \f[CB]classes.jar\f[R], that contains two class files,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   237
\f[CB]Foo.class\f[R] and \f[CB]Bar.class\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   238
.RS 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   239
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   240
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   241
\f[CB]jar\ \-\-create\ \-\-file\ classes.jar\ Foo.class\ Bar.class\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   242
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   243
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   244
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   245
Create an archive, \f[CB]classes.jar\f[R], by using an existing manifest,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   246
\f[CB]mymanifest\f[R], that contains all of the files in the directory
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   247
\f[CB]foo/\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   248
.RS 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   249
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   250
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   251
\f[CB]jar\ \-\-create\ \-\-file\ classes.jar\ \-\-manifest\ mymanifest\ \-C\ foo/\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   252
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   253
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   254
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   255
Create a modular JAR archive,\f[CB]foo.jar\f[R], where the module
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   256
descriptor is located in \f[CB]classes/module\-info.class\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   257
.RS 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   258
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   259
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   260
\f[CB]jar\ \-\-create\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Main\ \-\-module\-version\ 1.0\ \-C\ foo/classes\ resources\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   261
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   262
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   263
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   264
Update an existing non\-modular JAR, \f[CB]foo.jar\f[R], to a modular JAR
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   265
file.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   266
.RS 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   267
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   268
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   269
\f[CB]jar\ \-\-update\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Main\ \-\-module\-version\ 1.0\ \-C\ foo/module\-info.class\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   270
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   271
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   272
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   273
Create a versioned or multi\-release JAR, \f[CB]foo.jar\f[R], that places
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   274
the files in the \f[CB]classes\f[R] directory at the root of the JAR, and
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   275
the files in the \f[CB]classes\-10\f[R] directory in the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   276
\f[CB]META\-INF/versions/10\f[R] directory of the JAR.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   277
.RS 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   278
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   279
In this example, the \f[CB]classes/com/foo\f[R] directory contains two
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   280
classes, \f[CB]com.foo.Hello\f[R] (the entry point class) and
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   281
\f[CB]com.foo.NameProvider\f[R], both compiled for JDK 8.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   282
The \f[CB]classes\-10/com/foo\f[R] directory contains a different version
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   283
of the \f[CB]com.foo.NameProvider\f[R] class, this one containing JDK 10
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   284
specific code and compiled for JDK 10.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   285
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   286
Given this setup, create a multirelease JAR file \f[CB]foo.jar\f[R] by
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   287
running the following command from the directory containing the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   288
directories \f[CB]classes\f[R] and \f[CB]classes\-10\f[R] .
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   289
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   290
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   291
\f[CB]jar\ \-\-create\ \-\-file\ foo.jar\ \-\-main\-class\ com.foo.Hello\ \-C\ classes\ .\ \-\-release\ 10\ \-C\ classes\-10\ .\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   292
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   293
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   294
The JAR file \f[CB]foo.jar\f[R] now contains:
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   295
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   296
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   297
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   298
%\ jar\ \-tf\ foo.jar
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   299
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   300
META\-INF/
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   301
META\-INF/MANIFEST.MF
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   302
com/
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   303
com/foo/
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   304
com/foo/Hello.class
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   305
com/foo/NameProvider.class
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   306
META\-INF/versions/10/com/
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   307
META\-INF/versions/10/com/foo/
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   308
META\-INF/versions/10/com/foo/NameProvider.class
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   309
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   310
.fi
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   311
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   312
As well as other information, the file \f[CB]META\-INF/MANIFEST.MF\f[R],
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   313
will contain the following lines to indicate that this is a multirelease
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   314
JAR file with an entry point of \f[CB]com.foo.Hello\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   315
.IP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   316
.nf
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   317
\f[CB]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   318
\&...
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   319
Main\-Class:\ com.foo.Hello
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   320
Multi\-Release:\ true
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   321
\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   322
.fi
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   323
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   324
Assuming that the \f[CB]com.foo.Hello\f[R] class calls a method on the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   325
\f[CB]com.foo.NameProvider\f[R] class, running the program using JDK 10
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   326
will ensure that the \f[CB]com.foo.NameProvider\f[R] class is the one in
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   327
\f[CB]META\-INF/versions/10/com/foo/\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   328
Running the program using JDK 8 will ensure that the
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   329
\f[CB]com.foo.NameProvider\f[R] class is the one at the root of the JAR,
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   330
in \f[CB]com/foo\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   331
.RE
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   332
.IP \[bu] 2
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   333
Create an archive, \f[CB]my.jar\f[R], by reading options and lists of
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   334
class files from the file \f[CB]classes.list\f[R].
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   335
.RS 2
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 14342
diff changeset
   336
.PP
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   337
\f[B]Note:\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   338
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   339
To shorten or simplify the \f[CB]jar\f[R] command, you can specify
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   340
arguments in a separate text file and pass it to the \f[CB]jar\f[R]
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   341
command with the at sign (\f[CB]\@\f[R]) as a prefix.
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   342
.RS
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   343
.PP
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   344
\f[CB]jar\ \-\-create\ \-\-file\ my.jar\ \@classes.list\f[R]
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   345
.RE
55140
d4890c3721be 8225134: Update man-page files
jjg
parents: 52714
diff changeset
   346
.RE