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 "PACK200" "1" "2018" "JDK 13" "JDK Commands"
  25 .hy
  26 .SH NAME
  27 .PP
  28 pack200 \- transform a Java Archive (JAR) file into a compressed pack200
  29 file with the Java gzip compressor
  30 .SH SYNOPSIS
  31 .PP
  32 \f[CB]pack200\f[R] [\f[I]\-opt...\f[R] | \f[I]\-\-option=value\f[R]]
  33 \f[I]x.pack[.gz]\f[R] \f[I]JAR\-file\f[R]
  34 .TP
  35 .B \f[I]\-opt...\f[R] | \f[I]\-\-option=value\f[R]
  36 Options can be in any order.
  37 The last option on the command line or in a properties file supersedes
  38 all previously specified options.
  39 See \f[B]Options for the pack200 Command\f[R].
  40 .RS
  41 .RE
  42 .TP
  43 .B \f[I]x.pack[.gz]\f[R]
  44 Name of the output file.
  45 .RS
  46 .RE
  47 .TP
  48 .B \f[I]JAR\-file\f[R]
  49 Name of the input file.
  50 .RS
  51 .RE
  52 .SH DESCRIPTION
  53 .PP
  54 The \f[CB]pack200\f[R] command is a Java application that transforms a JAR
  55 file into a compressed \f[CB]pack200\f[R] file with the Java gzip
  56 compressor.
  57 This command packages a JAR file into a compressed \f[CB]pack200\f[R] file
  58 for web deployment.
  59 The \f[CB]pack200\f[R] files are highly compressed files that can be
  60 directly deployed to save bandwidth and reduce download time.
  61 .PP
  62 Typical usage is shown in the following example, where
  63 \f[CB]myarchive.pack.gz\f[R] is produced with the default \f[CB]pack200\f[R]
  64 command settings:
  65 .RS
  66 .PP
  67 \f[CB]pack200\ myarchive.pack.gz\ myarchive.jar\f[R]
  68 .RE
  69 .PP
  70 \f[B]Note:\f[R]
  71 .PP
  72 This command shouldn\[aq]t be confused with \f[CB]pack\f[R].
  73 The \f[CB]pack\f[R] and \f[CB]pack200\f[R] commands are separate products.
  74 The Java SE API Specification provided with the JDK is the superseding
  75 authority, when there are discrepancies.
  76 .SH EXIT STATUS
  77 .PP
  78 The following exit values are returned: 0 for successful completion and
  79 a number greater than 0 when an error occurs.
  80 .SH OPTIONS FOR THE PACK200 COMMAND
  81 .PP
  82 The \f[CB]pack200\f[R] command has several options to fine\-tune and set
  83 the compression engine.
  84 The typical usage is shown in the following example, where
  85 \f[CB]myarchive.pack.gz\f[R] is produced with the default \f[CB]pack200\f[R]
  86 command settings:
  87 .RS
  88 .PP
  89 \f[CB]pack200\ myarchive.pack.gz\ myarchive.jar\f[R]
  90 .RE
  91 .TP
  92 .B \f[CB]\-r\f[R] or \f[CB]\-\-repack\f[R]
  93 Produces a JAR file by packing and unpacking a JAR file.
  94 The resulting file can be used as an input to the \f[CB]jarsigner\f[R]
  95 tool.
  96 The following example packs and unpacks the myarchive.jar file:
  97 .RS
  98 .RS
  99 .PP
 100 \f[CB]pack200\ \-\-repack\ myarchive\-packer.jar\ myarchive.jar\f[R]
 101 .RE
 102 .RS
 103 .PP
 104 \f[CB]pack200\ \-\-repack\ myarchive.jar\f[R]
 105 .RE
 106 .RE
 107 .TP
 108 .B \f[CB]\-g\f[R] or\f[CB]\-\-no\-gzip\f[R]
 109 Produces a \f[CB]pack200\f[R] file.
 110 With this option, a suitable compressor must be used, and the target
 111 system must use a corresponding decompresser.
 112 .RS
 113 .RS
 114 .PP
 115 \f[CB]pack200\ \-\-no\-gzip\ myarchive.pack\ myarchive.jar\f[R]
 116 .RE
 117 .RE
 118 .TP
 119 .B \f[CB]\-\-gzip\f[R]
 120 (Default) Post\-compresses the pack output with \f[CB]gzip\f[R].
 121 .RS
 122 .RE
 123 .TP
 124 .B \f[CB]\-G\f[R] or \f[CB]\-\-strip\-debug\f[R]
 125 Strips debugging attributes from the output.
 126 These include \f[CB]SourceFile\f[R], \f[CB]LineNumberTable\f[R],
 127 \f[CB]LocalVariableTable\f[R] and \f[CB]LocalVariableTypeTable\f[R].
 128 Removing these attributes reduces the size of both downloads and
 129 installations, also reduces the usefulness of debuggers.
 130 .RS
 131 .RE
 132 .TP
 133 .B \f[CB]\-\-keep\-file\-order\f[R]
 134 Preserves the order of files in the input file.
 135 This is the default behavior.
 136 .RS
 137 .RE
 138 .TP
 139 .B \f[CB]\-O\f[R] or\f[CB]\-\-no\-keep\-file\-order\f[R]
 140 Reorders and transmits all elements.
 141 The packer can also remove JAR directory names to reduce the download
 142 size.
 143 However, certain JAR file optimizations, such as indexing, might not
 144 work correctly.
 145 .RS
 146 .RE
 147 .TP
 148 .B \f[CB]\-S\f[R]\f[I]N\f[R] or \f[CB]\-\-segment\-limit=\f[R]\f[I]N\f[R]
 149 The value is the estimated target size \f[I]N\f[R] (in bytes) of each
 150 archive segment.
 151 If a single input file requires more than \f[I]N\f[R] bytes, then its own
 152 archive segment is provided.
 153 As a special case, a value of \f[CB]\-1\f[R] produces a single large
 154 segment with all input files, while a value of 0 produces one segment
 155 for each class.
 156 Larger archive segments result in less fragmentation and better
 157 compression, but processing them requires more memory.
 158 .RS
 159 .PP
 160 The size of each segment is estimated by counting the size of each input
 161 file to be transmitted in the segment with the size of its name and
 162 other transmitted properties.
 163 .PP
 164 The default is \f[CB]\-1\f[R], which means that the packer creates a
 165 single segment output file.
 166 In cases where extremely large output files are generated, users are
 167 strongly encouraged to use segmenting or break up the input file into
 168 smaller JAR file.
 169 .PP
 170 A 10 MB JAR packed without this limit typically packs about 10 percent
 171 smaller, but the packer might require a larger Java heap (about 10 times
 172 the segment limit).
 173 .RE
 174 .TP
 175 .B \f[CB]\-E\f[R]\f[I]value\f[R] or \f[CB]\-\-effort=\f[R]\f[I]value\f[R]
 176 If the value is set to a single decimal digit, then the packer uses the
 177 indicated amount of effort in compressing the archive.
 178 Level 1 might produce somewhat larger size and faster compression speed,
 179 while level 9 takes much longer, but can produce better compression.
 180 The special value 0 instructs the \f[CB]pack200\f[R] command to copy
 181 through the original JAR file directly with no compression.
 182 The JSR 200 standard requires any unpacker to understand this special
 183 case as a pass\-through of the entire archive.
 184 .RS
 185 .PP
 186 The default is 5, to invest a modest amount of time to produce
 187 reasonable compression.
 188 .RE
 189 .TP
 190 .B \f[CB]\-H\f[R]\f[I]value\f[R] or \f[CB]\-\-deflate\-hint=\f[R]\f[I]value\f[R]
 191 Overrides the default, which preserves the input information, but can
 192 cause the transmitted archive to be larger.
 193 The possible values are: \f[CB]true\f[R], \f[CB]false\f[R], or
 194 \f[CB]keep\f[R].
 195 .RS
 196 .PP
 197 If the \f[CB]value\f[R] is \f[CB]true\f[R] or false, then the
 198 \f[CB]packer200\f[R] command sets the deflation hint accordingly in the
 199 output archive and doesn\[aq]t transmit the individual deflation hints
 200 of archive elements.
 201 .PP
 202 The \f[CB]keep\f[R] value preserves deflation hints observed in the input
 203 JAR.
 204 This is the default.
 205 .RE
 206 .TP
 207 .B \f[CB]\-m\f[R]\f[I]value\f[R] or \f[CB]\-\-modification\-time=\f[R]\f[I]value\f[R]
 208 The possible values are \f[CB]latest\f[R] and \f[CB]keep\f[R].
 209 .RS
 210 .PP
 211 If the value is \f[CB]latest\f[R], then the packer attempts to determine
 212 the latest modification time, among all the available entries in the
 213 original archive, or the latest modification time of all the available
 214 entries in that segment.
 215 This single value is transmitted as part of the segment and applied to
 216 all the entries in each segment.
 217 This can marginally decrease the transmitted size of the archive at the
 218 expense of setting all installed files to a single date.
 219 .PP
 220 If the value is \f[CB]keep\f[R], then modification times observed in the
 221 input JAR are preserved.
 222 This is the default.
 223 .RE
 224 .TP
 225 .B \f[CB]\-P\f[R]\f[I]file\f[R] or \f[CB]\-\-pass\-file=\f[R]\f[I]file\f[R]
 226 Indicates that a file should be passed through bytewise with no
 227 compression.
 228 By repeating the option, multiple files can be specified.
 229 There is no path name transformation, except that the system file
 230 separator is replaced by the JAR file separator forward slash (/).
 231 The resulting file names must match exactly as strings with their
 232 occurrences in the JAR file.
 233 If \f[I]file\f[R] is a directory name, then all files under that
 234 directory are passed.
 235 .RS
 236 .RE
 237 .TP
 238 .B \f[CB]\-U\f[R]\f[I]action\f[R] or \f[CB]\-\-unknown\-attribute=\f[R]\f[I]action\f[R]
 239 Overrides the default behavior, which means that the class file that
 240 contains the unknown attribute is passed through with the specified
 241 \f[I]action\f[R].
 242 The possible values for actions are \f[CB]error\f[R], \f[CB]strip\f[R], or
 243 \f[CB]pass\f[R].
 244 .RS
 245 .PP
 246 If the value is \f[CB]error\f[R], then the entire \f[CB]pack200\f[R] command
 247 operation fails with a suitable explanation.
 248 .PP
 249 If the value is \f[CB]strip\f[R], then the attribute is dropped.
 250 Removing the required Java Virtual Machine (JVM) attributes can cause
 251 class loader failures.
 252 .PP
 253 If the value is \f[CB]pass\f[R], then the entire class is transmitted as
 254 though it is a resource.
 255 .RE
 256 .TP
 257 .B \f[CB]\-C\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-class\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
 258 (user\-defined attribute) See the description for
 259 \f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R].
 260 .RS
 261 .RE
 262 .TP
 263 .B \f[CB]\-F\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-field\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
 264 (user\-defined attribute) See the description for
 265 \f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R].
 266 .RS
 267 .RE
 268 .TP
 269 .B \f[CB]\-M\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-method\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
 270 (user\-defined attribute) See the description for
 271 \f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R].
 272 .RS
 273 .RE
 274 .TP
 275 .B \f[CB]\-D\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R] or \f[CB]\-\-code\-attribute=\f[R]\f[I]attribute\-name\f[R]\f[CB]=\f[R]\f[I]layout\f[R]
 276 (user\-defined attribute) The attribute layout can be specified for a
 277 class entity, such as \f[CB]class\-attribute\f[R],
 278 \f[CB]field\-attribute\f[R], \f[CB]method\-attribute\f[R], and
 279 \f[CB]code\-attribute\f[R].
 280 The \f[I]attribute\-name\f[R] is the name of the attribute for which the
 281 layout or action is being defined.
 282 The possible values for \f[I]action\f[R] are
 283 \f[I]some\-layout\-string\f[R], \f[CB]error\f[R], \f[CB]strip\f[R],
 284 \f[CB]pass\f[R].
 285 .RS
 286 .PP
 287 \f[I]some\-layout\-string\f[R]: The layout language is defined in the JSR
 288 200 specification, for example:
 289 \f[CB]\-\-class\-attribute=SourceFile=RUH\f[R].
 290 .PP
 291 If the value is \f[CB]error\f[R], then the \f[CB]pack200\f[R] operation
 292 fails with an explanation.
 293 .PP
 294 If the value is \f[CB]strip\f[R], then the attribute is removed from the
 295 output.
 296 Removing JVM\-required attributes can cause class loader failures.
 297 For example, \f[CB]\-\-class\-attribute=CompilationID=pass\f[R] causes the
 298 class file that contains this attribute to be passed through without
 299 further action by the packer.
 300 .PP
 301 If the value is \f[CB]pass\f[R], then the entire class is transmitted as
 302 though it\[aq]s a resource.
 303 .RE
 304 .TP
 305 .B \f[CB]\-f\f[R]\f[I]pack.properties\f[R] or \f[CB]\-\-config\-file=\f[R]\f[I]pack.properties\f[R]
 306 Indicates a configuration file, containing Java properties to initialize
 307 the packer, can be specified on the command line.
 308 .RS
 309 .IP
 310 .nf
 311 \f[CB]
 312 pack200\ \-f\ pack.properties\ myarchive.pack.gz\ myarchive.jar
 313 more\ pack.properties
 314 #\ Generic\ properties\ for\ the\ packer.
 315 modification.time=latest
 316 deflate.hint=false
 317 keep.file.order=false
 318 #\ This\ option\ will\ cause\ the\ files\ bearing\ new\ attributes\ to
 319 #\ be\ reported\ as\ an\ error\ rather\ than\ passed\ uncompressed.
 320 unknown.attribute=error
 321 #\ Change\ the\ segment\ limit\ to\ be\ unlimited.
 322 segment.limit=\-1
 323 \f[R]
 324 .fi
 325 .RE
 326 .TP
 327 .B \f[CB]\-v\f[R] or \f[CB]\-\-verbose\f[R]
 328 Outputs minimal messages.
 329 Multiple specification of this option will create more verbose messages.
 330 .RS
 331 .RE
 332 .TP
 333 .B \f[CB]\-q\f[R] or \f[CB]\-\-quiet\f[R]
 334 Specifies quiet operation with no messages.
 335 .RS
 336 .RE
 337 .TP
 338 .B \f[CB]\-l\f[R]\f[I]filename\f[R] or \f[CB]\-\-log\-file=\f[R]\f[I]filename\f[R]
 339 Specifies a log file to output messages.
 340 .RS
 341 .RE
 342 .TP
 343 .B \f[CB]\-?\f[R], \f[CB]\-h\f[R], or\f[CB]\-\-help\f[R]
 344 Prints help information about this command.
 345 .RS
 346 .RE
 347 .TP
 348 .B \f[CB]\-V\f[R] or \f[CB]\-\-version\f[R]
 349 Prints version information about this command.
 350 .RS
 351 .RE
 352 .TP
 353 .B \f[CB]\-J\f[R]\f[I]option\f[R]
 354 Passes the specified \f[I]option\f[R] to the Java Virtual Machine.
 355 For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB.
 356 .RS
 357 .RE