NAME
pack200 - JAR Packing tool
SYNOPSIS
ppaacckk220000 [ OPTIONS ] output-file JAR-file
PPAARRAAMMEETTEERRSS The options may be in any order. The last option on the command line or in a properties file supersedes all previously specified options. For adiscussion of the options, see OPTIONS below.
OPTIONS see OPTIONS below.
output-file name of the output file.
JAR-file name of the input file.
DESCRIPTION
The pack200 tool is a Java application that transforms a JAR file into
a compressed pack200 file using the Java gzip compressor. The com-
pressed packed files are highly compressed JARs that can be directly deployed, saving bandwidth and reducing download time.The pack200 tool uses several options to fine-tune and set the compres-
sion engine. Typical usage:%% ppaacckk220000 mmyyaarrcchhiivvee..ppaacckk..ggzz mmyyaarrcchhiivvee..jjaarr
In this example, the myarchive.pack.gz is produced, using the default ppaacckk220000 and ggzziipp settings. OOPPTTIIOONNSS-rr --rreeppaacckk
Produces a JAR file by packing the file myarchive.jar, and unpacking it. The resulting file can be used as an input to the jarsigner(1) tool.%% ppaacckk220000 --rreeppaacckk mmyyaarrcchhiivvee-ppaacckkeedd..jjaarr mmyyaarrcchhiivvee..jjaarr
%% ppaacckk220000 --rreeppaacckk mmyyaarrcchhiivvee..jjaarr
-gg --nnoo-ggzziipp
Produces a pack200 file. With this option a suitable compressor
must be used, and the target system must also use a correspond-
ing decompressor.%% ppaacckk220000 --nnoo-ggzziipp mmyyaarrcchhiivvee..ppaacckk mmyyaarrcchhiivvee..jjaarr
-GG --ssttrriipp-ddeebbuugg
Strips the attributes used for debugging, from the output. These include SourceFile, LineNumberTable, LocalVariableTable and LocalVariableTypeTable. Removing these attributes reduces thesize of both downloads and installations but reduces the useful-
ness of debuggers.-OO --nnoo-kkeeeepp-ffiillee-oorrddeerr
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.-SSvalue --sseeggmmeenntt-lliimmiitt==value
The value is the estimated target size N (in bytes) of each ar-
chive segment. If a single input file requires more than N bytes, it will be given its own archive segment. As a specialcase, a value of -1 will produce a single large segment with all
input files, while a value of 0 will produce one segment for each class. Larger archive segments result in less fragmentationand better compression, but processing them requires more mem-
ory. 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 1000000 (a million bytes). This allows input JAR files of moderate size to be transmitted in one segment. It also puts a limit on memory requirements for packers and unpackers. A 10MB JAR packed without this limit will typically pack about10% smaller, but the packer may require a larger Java heap
(about ten times the segment limit).-EEvalue --eeffffoorrtt==value
If the value is set to a single decimal digit, the packer will use the indicated amount of effort in compressing the archive. Level 1 may produce somewhat larger size and faster compressionspeed, while level 9 will take much longer but may produce bet-
ter compression. The special value 0 instructs the packer tocopy through the original JAR file directly, with no compres-
sion. The JSR 200 standard requires any unpacker to understandthis special case as a pass-through of the entire archive.
The default is 5, investing a modest amount of time to produce reasonable compression.-HHvalue --ddeeffllaattee-hhiinntt==value
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.)-mmvalue --mmooddiiffiiccaattiioonn-ttiimmee==value
The possible values are: latestThe packer will attempt to determine the latest modifica-
tion time, among all the available entries in the originalarchive, or the latest modification time of all the avail-
able 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 Preserve modification times observed in the input JAR. (This is the default.)-PPfile -ppaassss-ffiillee==file
Indicates that a file should be passed through byte-wise 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 '/'. 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.-UUaction --uunnkknnoowwnn-aattttrriibbuuttee==action
Overrides the default behavior, ie. the classfile containing the unknown attribute will be passed through with the specified action. The possible values for actions are: error:The pack200 operation as a whole will fail, with a suit-
able explanation. strip: The attribute will be dropped. Note: removing the VM required attributes may cause Class Loader failures. pass: Upon encountering this attribute, the entire class will be transmitted as though it is a resource. (This is the default.)-CCattribute-name==layout --ccllaassss-aattttrriibbuuttee==attribute-name==action
-FFattribute-name==layout --ffiieelldd-aattttrriibbuuttee==attribute-name==action
-MMattribute-name==layout --mmeetthhoodd-aattttrriibbuuttee==attribute-name==action
-DDattribute-name==layout --ccooddee-aattttrriibbuuttee==attribute-name==action
With the above four options, the attribute layout can be speci-
fied for a class entity, such as Class attribute, Fieldattribute, 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 specifica-
tion. For example -class-attribute=SourceFile=RUH.
errorupon 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 the VM required attributes may cause Class Loader failures. pass upon encountering this attribute, the entire class will be transmitted as though it is a resource.Example -class-attribute=CompilationID=pass, will cause
the classfile containing this attribute to be passed through, without further action by the packer.-ffppaacckk..pprrooppeerrttiieess --ccoonnffiigg-ffiillee==ppaacckk..pprrooppeerrttiieess
A configuration file, containing Java properties to initialize the packer, may be specified on the command line.%% ppaacckk220000 -ff ppaacckk..pprrooppeerrttiieess mmyyaarrcchhiivvee..ppaacckk..ggzz mmyyaarrcchhiivvee..jjaarr
%% ccaatt ppaacckk..pprrooppeerrttiieess
## GGeenneerriicc pprrooppeerrttiieess ffoorr tthhee ppaacckkeerr..
mmooddiiffiiccaattiioonn..ttiimmee==llaatteesstt ddeeffllaattee..hhiinntt==ffaallssee kkeeeepp..ffiillee..oorrddeerr==ffaallssee## TThhiiss ooppttiioonn wwiillll ccaauussee tthhee ffiilleess bbeeaarriinngg nneeww aattttrriibbuutteess ttoo
## bbee rreeppoorrtteedd aass aann eerrrroorr rraatthheerr tthhaann ppaasssseedd uunnccoommpprreesssseedd..
uunnkknnoowwnn..aattttrriibbuuttee==eerrrroorr## CChhaannggee tthhee sseeggmmeenntt lliimmiitt ttoo bbee uunnlliimmiitteedd..
sseeggmmeenntt..lliimmiitt==-11
NonStandard Options-vv --vveerrbboossee Outputs minimal messages, multiple specification of
this option will output more verbose messages.-qq --qquuiieett Quiet operation with no messages.
-llfilename --lloogg-ffiillee==filename
A log file to output messages.-JJoption Passes option to the Java launcher called by
pack200. For example, -J-Xms48m sets the startup
memory to 48 megabytes. Although it does not beginwith -X, it is not a `standard option' of
pack200. It is a common convention for -J to pass
options to the underlying VM executing applications written in Java. EEXXIITT SSTTAATTUUSS The following exit values are returned: 00 SSuucccceessssffuull ccoommpplleettiioonn.. >>00 AAnn eerrrroorr ooccccuurrrreedd..SEE ALSO
uunnppaacckk220000(1), jjaarr(1), jjaarrssiiggnneerr(1), aattttrriibbuutteess(5) For API specification and other related information: http://java.sun.com/j2se/5.0/docshttp://java.sun.com/j2se/5.0/docs/guide/deployment/deployment-
guide/pack200.html
NNOOTTEESS:: This command should not be confused with ppaacckk(1). They are distinctly separate products.The J2SE API Specification provided with the JDK release is the super-
seding authority, in case of discrepancies.14 July 2004 pack200(1)