## Name

pack200 - JAR Packing tool

## SYNOPSIS

f4pack200f2 [ f2options ] f2output-file f2JAR-file

Options may be in any order. The last option on the command line or in a properties file supersedes all previously specified options.

options Command-line options.

output-file Name of the output file.

JAR-file Name of the input file.

## DESCRIPTION

The f2pack200 tool is a Java application that transforms a JAR file into a compressed f2pack200 file using the Java f2gzip compressor. The f2pack200 files are highly compressed files that can be directly deployed, saving bandwidth and reducing download time.

The f2pack200 tool uses several options to fine-tune and set the compression engine.

##

Typical usage:

f2% pack200 myarchive.pack.gz myarchive.jar

In this example, f2myarchive.pack.gz is produced using the default f2pack200 settings.

## OPTIONS

f4-r --repack

Produces a JAR file by packing the file f2myarchive.jar and unpacking it. The resulting file can be used as an input to the f2jarsigner(1) tool.

f2% pack200 --repack myarchive-packer.jar myarchive.jar

f2% pack200 --repack myarchive.jar

f4-g --no-gzip

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

f2% pack200 --no-gzip myarchive.pack myarchive.jar

f4-G --strip-debug

Strips attributes used for debugging from the output. These include f2SourceFile, f2LineNumberTable, f2LocalVariableTable and f2LocalVariableTypeTable. Removing these attributes reduces the size of both downloads and installations but reduces the usefulness of debuggers.

f4--keep-file-order

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

f4-O --no-keep-file-order

The packer will reorder and transmit all elements. Additionally, the packer may remove JAR directory names. This will reduce the download size; however, certain JAR file optimizations, such as indexing, may not work correctly.

f4-Svalue --segment-limit=f2value

The value is the estimated target size N (in bytes) of each archive segment. If a single input file requires
more than N bytes, it will be given its own archive segment. As a special case, a value of f2-1 will produce a single large segment with all input files, while a value of f20 will produce 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, along with the size of its name and other transmitted properties.

The default is -1, which means the packer will always create 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 10MB JAR packed without this limit will typically pack about 10% smaller, but the packer may require a larger Java heap (about ten times the segment limit).

f4-Evalue --effort=f2value

If the value is set to a single decimal digit, the packer will use the indicated amount of effort in compressing the archive. Level f21 may produce somewhat larger size and faster compression speed, while level f29 will take much longer but may produce better compression. The special value f20 instructs the packer 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 f25, investing a modest amount of time to produce reasonable compression.

f4-Hvalue --deflate-hint=f2value

Overrides the default, which preserves the input information, but may cause the transmitted archive to be larger. The possible values are:

true

false In either case, the packer will set the deflation hint accordingly in the output archive, and will not transmit the individual deflation hints of archive elements.

keep Preserve deflation hints observed in the input JAR. (This is the default.)

f4-mvalue --modification-time=f2value

The possible values are:

latest The packer will attempt 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 will be 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.

keep Preserves modification times observed in the input JAR. (This is the default.)

f4-Pfile --pass-file=f2file

Indicates that a file should be passed through bytewise with no compression. By repeating the option, multiple files may be specified. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator "f2/". The resulting file names must match exactly as strings with their occurrences in the JAR file. If file is a directory name, all files under that directory will be passed.

f4-Uaction --unknown-attribute=f2action

Overrides the default behavior; i.e., the classfile containing the unknown attribute will be passed through with the specified action. The possible values for actions are:

error The f2pack200 operation as a whole will fail with a suitable explanation.

strip The attribute will be dropped. Note: Removing the required VM attributes may cause Class Loader failures.

pass Upon encountering this attribute, the entire class will be transmitted as though it is a resource.

f4-Cattribute-name=f2layout f3--class-attribute=f2attribute-name=action
f4-Fattribute-name=f2layout f3--field-attribute=f2attribute-name=action
f4-Mattribute-name=f2layout f3--method-attribute=f2attribute-name=action
f4-Dattribute-name=f2layout f3--code-attribute=f2attribute-name=action

With the above four options, the attribute layout can be specified for a class entity, such as Class attribute, Field attribute, Method attribute, and Code 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:

some-layout-string The layout language is defined in the JSR 200 specification.

Example: f2--class-attribute=SourceFile=RUH

error Upon encountering this attribute, the pack200 operation will fail with a suitable explanation.

strip Upon encountering this attribute, the attribute will be removed from the output. Note: removing VM-required attributes may cause Class Loader failures.

Example: f2--class-attribute=CompilationID=pass will cause the class file containing this attribute to be passed through without further action by the packer.

f4-ff2 f2pack.properties f3--config-file=f2pack.properties

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

f2% pack200 -f pack.properties myarchive.pack.gz myarchive.jar
f2% more pack.properties
f2# Generic properties for the packer.
f2modification.time=latest
f2deflate.hint=false
f2keep.file.order=false
f2# This option will cause the files bearing new attributes to
f2# be reported as an error rather than passed uncompressed.
f2unknown.attribute=error
f2# Change the segment limit to be unlimited.
f2segment.limit=-1

f4-v --verbose

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

f4-q --quiet

Specifies quiet operation with no messages.

f4-lfilename --log-file=f2filename

Specifies a log file to output messages.

f4-? -h --help

Prints help information about this command.

f4-V --version

Prints version information about this command.

f4-Jf2option

Passes f2option to the Java launcher called by f2pack200. For example, f2-J-Xms48m sets the startup memory to 48 megabytes. Although it does not begin with f2-X, it is not a standard option of f2pack200. It is a common convention for f2-J to pass options to the underlying VM executing applications written in Java.

## EXIT STATUS

The following exit values are returned:

f2 0 for successful completion;

f2>0 if an error occurs.

## SEE ALSO

o unpack200(1)

o

f2Java SE Documentation @

http://docs.oracle.com/javase/7/docs/index.html

o

f2Java Deployment Guide - Pack200 @

http://docs.oracle.com/javase/7/docs/technotes/guides/deployment/deployment-guide/pack200.html

o jar(1) - Java Archive Tool

o jarsigner(1) - JAR Signer tool

o f2attributes(5) man page

## NOTES

This command should not be confused with f2pack(1). They are distinctly separate products.

The Java SE API Specification provided with the JDK is the superseding authority, in case of discrepancies.