t
Copyright (c) 2004, 2013, 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.

Arch: generic
Software: JDK 8
Date: 21 November 2013
SectDesc: Java Deployment Tools
Title: pack200.1

pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
-----------------------------------------------------------------
* Define some portability stuff
-----------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://bugs.debian.org/507673
http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------
* set default formatting
-----------------------------------------------------------------
disable hyphenation
disable justification (adjust text to left margin only)
-----------------------------------------------------------------
* MAIN CONTENT STARTS HERE *
-----------------------------------------------------------------
NAME
pack200 - Packages a JAR file into a compressed pack200 file for web deployment.
SYNOPSIS
 

pack200 [options] output-file JAR-file
Options can be in any order. The last option on the command line or in a properties file supersedes all previously specified options.

options The command-line options. See Options.

output-file Name of the output file.

JAR-file Name of the input file.

DESCRIPTION
The \f3pack200 command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time.

The \f3pack200 command has several options to fine-tune and set the compression engine. The typical usage is shown in the following example, where \f3myarchive.pack.gz is produced with the default \f3pack200 command settings:

 
\f3pack200 myarchive.pack.gz myarchive.jar
 
\f3
OPTIONS

-r, --repack

Produces a JAR file by packing and unpacking a JAR file. The resulting file can be used as an input to the \f3jarsigner(1) tool. The following example packs and unpacks the myarchive.jar file:

 
\f3pack200 --repack myarchive-packer.jar myarchive.jar
 
\f3pack200 --repack myarchive.jar
 
\f3
The following example preserves the order of files in the input file.

-g, --no-gzip

Produces a \f3pack200 file. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser.

 
\f3pack200 --no-gzip myarchive.pack myarchive.jar
 
\f3

-G, --strip-debug

Strips debugging attributes from the output. These include \f3SourceFile, \f3LineNumberTable, \f3LocalVariableTable and \f3LocalVariableTypeTable. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers.

--keep-file-order

Preserve the order of files in the input file. This is the default behavior.

-O, --no-keep-file-order

The packer reorders and transmits all elements. The packer can also remove JAR directory names to reduce the download size. However, certain JAR file optimizations, such as indexing, might not work correctly.

-Svalue , --segment-limit=value

The value is the estimated target size N (in bytes) of each archive segment. If a single input file requires more than N bytes, then its own archive segment is provided. As a special case, a value of \f3-1 produces a single large segment with all input files, while a value of 0 produces one segment for each class. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory. The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties. The default is -1, which means that the packer creates a single segment output file. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs. A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit).

-Evalue , --effort=value

If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression. The special value 0 instructs the \f3pack200 command to copy through the original JAR file directly with no compression. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive. The default is 5, to invest a modest amount of time to produce reasonable compression.

-Hvalue , --deflate-hint=value

Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger. The possible values are: \f3true, \f3false, or \f3keep. If the \f3value is \f3true or false, then the \f3packer200 command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements. The \f3keep value preserves deflation hints observed in the input JAR. This is the default.

-mvalue , --modification-time=value

The possible values are \f3latest and \f3keep. If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment. This single value is transmitted as part of the segment and applied to all the entries in each segment. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date. If the value is \f3keep, then modification times observed in the input JAR are preserved. This is the default.

-Pfile , --pass-file=file

Indicates that a file should be passed through bytewise with no compression. By repeating the option, multiple files can be specified. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/). The resulting file names must match exactly as strings with their occurrences in the JAR file. If \f3file is a directory name, then all files under that directory are passed.

-Uaction , --unknown-attribute=action

Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action. The possible values for actions are \f3error, \f3strip, or \f3pass. If the value is \f3error, then the entire \f3pack200 command operation fails with a suitable explanation. If the value is \f3strip, then the attribute is dropped. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures. If the value is \f3pass, then the entire class is transmitted as though it is a resource.

-Cattribute-name=layout , --class-attribute=attribute-name=action

See next option.

-Fattribute-name=layout , --field-attribute=attribute-name=action

See next option.

-Mattribute-name=layout , --method-attribute=attribute-name=action

See next option.

-Dattribute-name=layout , --code-attribute=attribute-name=action

With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute, \f3field-attribute, \f3method-attribute, and \f3code-attribute. The attribute-name is the name of the attribute for which the layout or action is being defined. The possible values for action are \f3some-layout-string, \f3error, \f3strip, \f3pass. \f3some-layout-string: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH. If the value is \f3error, then the \f3pack200 operation fails with an explanation. If the value is \f3strip, then the attribute is removed from the output. Removing JVM-required attributes can cause class loader failures. For example, \f3--class-attribute=CompilationID=pass causes the class file that contains this attribute to be passed through without further action by the packer. If the value is \f3pass, then the entire class is transmitted as though it is a resource.

-f pack.properties , --config-file=pack.properties

A configuration file, containing Java properties to initialize the packer, can be specified on the command line.

 
\f3pack200 -f pack.properties myarchive.pack.gz myarchive.jar
 
\f3more pack.properties
 
\f3# Generic properties for the packer.
 
\f3modification.time=latest
 
\f3deflate.hint=false
 
\f3keep.file.order=false
 
\f3# This option will cause the files bearing new attributes to
 
\f3# be reported as an error rather than passed uncompressed.
 
\f3unknown.attribute=error
 
\f3# Change the segment limit to be unlimited.
 
\f3segment.limit=-1
 
\f3

-v, --verbose

Outputs minimal messages. Multiple specification of this option will create more verbose messages.

-q, --quiet

Specifies quiet operation with no messages.

-lfilename , --log-file=filename

Specifies a log file to output messages.

-?, -h, --help

Prints help information about this command.

-V, --version

Prints version information about this command.

-Joption

Passes the specified option to the Java Virtual Machine. For more information, see the reference page for the java(1) command. For example, \f3-J-Xms48m sets the startup memory to 48 MB.

EXIT STATUS
The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs.
NOTES
This command should not be confused with \f3pack(1). The \f3pack and \f3pack200 commands are separate products.

The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies.

SEE ALSO

0.2i unpack200(1)

0.2i jar(1)

0.2i jarsigner(1)

'pl 8.5i 'bp