blob: ad9117ae6cfbd9815efa1e25ecab322a368f7526 [file] [log] [blame]
duke6e45e102007-12-01 00:00:00 +00001." Copyright 2004-2006 Sun Microsystems, Inc. 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."
ohair2283b9d2010-05-25 15:58:33 -070018." 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.
tbell16c34dd2009-05-04 18:28:26 -070021."
22.TH pack200 1 "04 May 2009"
23." Generated from HTML by html2man (author: Eric Armstrong)
duke6e45e102007-12-01 00:00:00 +000024
25.LP
tbell16c34dd2009-05-04 18:28:26 -070026.SH "Name"
duke6e45e102007-12-01 00:00:00 +000027pack200 \- JAR Packing tool
28.LP
29.SH "SYNOPSIS"
30.LP
31
32.LP
33.LP
34\f4pack200\fP\f2 [ \fP\f2options\fP ] \f2output\-file\fP \f2JAR\-file\fP
35.LP
36.LP
37Options may be in any order. The last option on the command line or in a properties file supersedes all previously specified options.
38.LP
39.RS 3
40
41.LP
tbell16c34dd2009-05-04 18:28:26 -070042.RS 3
duke6e45e102007-12-01 00:00:00 +000043.TP 3
44options
45Command\-line options.
46.TP 3
47output\-file
48Name of the output file.
49.TP 3
50JAR\-file
51Name of the input file.
tbell16c34dd2009-05-04 18:28:26 -070052.RE
53
duke6e45e102007-12-01 00:00:00 +000054.LP
55.RE
56.SH "DESCRIPTION"
57.LP
58
59.LP
60.LP
61The \f2pack200\fP tool is a Java application that transforms a JAR file into a compressed \f2pack200\fP file using the Java \f2gzip\fP compressor. The \f2pack200\fP files are highly compressed files that can be directly deployed, saving bandwidth and reducing download time.
62.LP
63.LP
64The \f2pack200\fP tool uses several options to fine\-tune and set the compression engine.
65.LP
66.SS
67Typical usage:
68.LP
tbell16c34dd2009-05-04 18:28:26 -070069.RS 3
duke6e45e102007-12-01 00:00:00 +000070
71.LP
72.LP
73\f2% pack200 myarchive.pack.gz myarchive.jar\fP
74.LP
tbell16c34dd2009-05-04 18:28:26 -070075.RE
duke6e45e102007-12-01 00:00:00 +000076.LP
77In this example, \f2myarchive.pack.gz\fP is produced using the default \f2pack200\fP settings.
78.LP
79.SH "OPTIONS"
80.LP
81
82.LP
83.LP
84\f4\-r \-\-repack\fP
85.LP
86.RS 3
87
88.LP
89.LP
90Produces a JAR file by packing the file \f2myarchive.jar\fP and unpacking it. The resulting file can be used as an input to the \f2jarsigner(1)\fP tool.
91.LP
92.RS 3
93
94.LP
95.LP
96\f2% pack200 \-\-repack myarchive\-packer.jar myarchive.jar\fP
97.LP
98.LP
99\f2% pack200 \-\-repack myarchive.jar\fP
100.LP
101.RE
102.RE
103.LP
104\f4\-g \-\-no\-gzip\fP
105.LP
106.RS 3
107
108.LP
109.LP
110Produces a \f2pack200\fP file. With this option a suitable compressor must be used, and the target system must use a corresponding decompresser.
111.LP
112.RS 3
113
114.LP
115.LP
116\f2% pack200 \-\-no\-gzip myarchive.pack myarchive.jar\fP
117.LP
118.RE
119.RE
120.LP
121\f4\-G \-\-strip\-debug\fP
122.LP
123.RS 3
124
125.LP
126.LP
127Strips attributes used for debugging from the output. These include \f2SourceFile\fP, \f2LineNumberTable\fP, \f2LocalVariableTable\fP and \f2LocalVariableTypeTable\fP. Removing these attributes reduces the size of both downloads and installations but reduces the usefulness of debuggers.
128.LP
129.RE
130.LP
131\f4\-O \-\-no\-keep\-file\-order\fP
132.LP
133.RS 3
134
135.LP
136.LP
137The 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.
138.LP
139.RE
140.LP
141\f4\-Svalue \-\-segment\-limit=\fP\f2value\fP
142.LP
143.RS 3
144
145.LP
146.LP
147The value is the estimated target size N (in bytes) of each archive segment. If a single input file requires
148.br
149more than N bytes, it will be given its own archive segment. As a special case, a value of \f2\-1\fP will produce a single large segment with all input files, while a value of \f20\fP will produce one segment for each class. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory.
150.LP
151.LP
152The 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.
153.LP
154.LP
155The default is \f21000000\fP (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.
156.LP
157.LP
158A 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).
159.LP
160.RE
161.LP
162\f4\-Evalue \-\-effort=\fP\f2value\fP
163.LP
164.RS 3
165
166.LP
167.LP
168If the value is set to a single decimal digit, the packer will use the indicated amount of effort in compressing the archive. Level \f21\fP may produce somewhat larger size and faster compression speed, while level \f29\fP will take much longer but may produce better compression. The special value \f20\fP 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.
169.LP
170.LP
171The default is \f25\fP, investing a modest amount of time to produce reasonable compression.
172.LP
173.RE
174.LP
175\f4\-Hvalue \-\-deflate\-hint=\fP\f2value\fP
176.LP
177.RS 3
178
179.LP
180.LP
181Overrides the default, which preserves the input information, but may cause the transmitted archive to be larger. The possible values are:
182.LP
tbell16c34dd2009-05-04 18:28:26 -0700183.RS 3
duke6e45e102007-12-01 00:00:00 +0000184.TP 3
185true
186.TP 3
187false
188In 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.
tbell16c34dd2009-05-04 18:28:26 -0700189.RE
190
duke6e45e102007-12-01 00:00:00 +0000191.LP
tbell16c34dd2009-05-04 18:28:26 -0700192.RS 3
duke6e45e102007-12-01 00:00:00 +0000193.TP 3
194keep
195Preserve deflation hints observed in the input JAR. (This is the default.)
tbell16c34dd2009-05-04 18:28:26 -0700196.RE
197
duke6e45e102007-12-01 00:00:00 +0000198.LP
199.RE
200.LP
201\f4\-mvalue \-\-modification\-time=\fP\f2value\fP
202.LP
203.RS 3
204
205.LP
206.LP
207The possible values are:
208.LP
tbell16c34dd2009-05-04 18:28:26 -0700209.RS 3
duke6e45e102007-12-01 00:00:00 +0000210.TP 3
211latest
212The 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.
213.TP 3
214keep
215Preserves modification times observed in the input JAR. (This is the default.)
tbell16c34dd2009-05-04 18:28:26 -0700216.RE
217
duke6e45e102007-12-01 00:00:00 +0000218.LP
219.RE
220.LP
221\f4\-Pfile \-\-pass\-file=\fP\f2file\fP
222.LP
223.RS 3
224
225.LP
226.LP
227Indicates 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/\fP". 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.
228.LP
229.RE
230.LP
231\f4\-Uaction \-\-unknown\-attribute=\fP\f2action\fP
232.LP
233.RS 3
234
235.LP
236.LP
237Overrides 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:
238.LP
tbell16c34dd2009-05-04 18:28:26 -0700239.RS 3
duke6e45e102007-12-01 00:00:00 +0000240.TP 3
241error
242The \f2pack200\fP operation as a whole will fail with a suitable explanation.
243.TP 3
244strip
245The attribute will be dropped. Note: Removing the required VM attributes may cause Class Loader failures.
246.TP 3
247pass
248Upon encountering this attribute, the entire class will be transmitted as though it is a resource.
tbell16c34dd2009-05-04 18:28:26 -0700249.RE
250
duke6e45e102007-12-01 00:00:00 +0000251.LP
252.RE
253.LP
254\f4\-Cattribute\-name=\fP\f2layout\fP \f3\-\-class\-attribute=\fP\f2attribute\-name=action\fP
255.br
tbell16c34dd2009-05-04 18:28:26 -0700256\f4\-Fattribute\-name=\fP\f2layout\fP \f3\-\-field\-attribute=\fP\f2attribute\-name=action\fP
duke6e45e102007-12-01 00:00:00 +0000257.br
tbell16c34dd2009-05-04 18:28:26 -0700258\f4\-Mattribute\-name=\fP\f2layout\fP \f3\-\-method\-attribute=\fP\f2attribute\-name=action\fP
duke6e45e102007-12-01 00:00:00 +0000259.br
tbell16c34dd2009-05-04 18:28:26 -0700260\f4\-Dattribute\-name=\fP\f2layout\fP \f3\-\-code\-attribute=\fP\f2attribute\-name=action\fP
duke6e45e102007-12-01 00:00:00 +0000261.LP
262.RS 3
263
264.LP
265.LP
266With 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:
267.LP
tbell16c34dd2009-05-04 18:28:26 -0700268.RS 3
duke6e45e102007-12-01 00:00:00 +0000269.TP 3
270some\-layout\-string
271The layout language is defined in the JSR 200 specification.
272.LP
273Example: \f2\-\-class\-attribute=SourceFile=RUH\fP
274.TP 3
275error
276Upon encountering this attribute, the pack200 operation will fail with a suitable explanation.
277.TP 3
278strip
279Upon encountering this attribute, the attribute will be removed from the output. Note: removing VM\-required attributes may cause Class Loader failures.
tbell16c34dd2009-05-04 18:28:26 -0700280.RE
281
duke6e45e102007-12-01 00:00:00 +0000282.LP
283.LP
284Example: \f2\-\-class\-attribute=CompilationID=pass\fP will cause the class file containing this attribute to be passed through without further action by the packer.
285.LP
286.RE
287.LP
288\f4\-f\fP\f2 \fP\f2pack.properties\fP \f3\-\-config\-file=\fP\f2pack.properties\fP
289.LP
290.RS 3
291
292.LP
293.LP
294A configuration file, containing Java properties to initialize the packer, may be specified on the command line.
295.LP
296.RS 3
297
298.LP
299.LP
300\f2% pack200 \-f pack.properties myarchive.pack.gz myarchive.jar\fP
301.br
302\f2% more pack.properties\fP
303.br
304\f2# Generic properties for the packer.\fP
305.br
306\f2modification.time=latest\fP
307.br
308\f2deflate.hint=false\fP
309.br
310\f2keep.file.order=false\fP
311.br
312\f2# This option will cause the files bearing new attributes to\fP
313.br
314\f2# be reported as an error rather than passed uncompressed.\fP
315.br
316\f2unknown.attribute=error\fP
317.br
318\f2# Change the segment limit to be unlimited.\fP
319.br
320\f2segment.limit=\-1\fP
321.LP
322.RE
323.RE
324.RS 3
325
326.LP
327.LP
328\f4\-v \-\-verbose\fP
329.LP
330.RS 3
331
332.LP
333.LP
334Outputs minimal messages. Multiple specification of this option will output more verbose messages.
335.LP
336.RE
337.LP
338\f4\-q \-\-quiet\fP
339.LP
340.RS 3
341
342.LP
343.LP
344Specifies quiet operation with no messages.
345.LP
346.RE
347.LP
348\f4\-lfilename \-\-log\-file=\fP\f2filename\fP
349.LP
350.RS 3
351
352.LP
353.LP
354Specifies a log file to output messages.
355.LP
356.RE
357.LP
358\f4\-Joption\fP
359.LP
360.RS 3
361
362.LP
363.LP
364Passes option to the Java launcher called by \f2pack200\fP. For example, \f2\-J\-Xms48m\fP sets the startup memory to 48 megabytes. Although it does not begin with \f2\-X\fP, it is not a standard option of \f2pack200\fP. It is a common convention for \f2\-J\fP to pass options to the underlying VM executing applications written in Java.
365.LP
366.RE
367.RE
368.SH "EXIT STATUS"
369.LP
370
371.LP
372.LP
373The following exit values are returned:
374.LP
375.RS 3
376
377.LP
378.LP
379\f2\ 0\fP for successful completion;
380.LP
381.LP
382\f2>0\fP if an error occurs.
383.LP
384.RE
385.SH "SEE ALSO"
386.LP
387.RS 3
388.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700389o
390unpack200(1)
duke6e45e102007-12-01 00:00:00 +0000391.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700392o
393.na
394\f2Java SE Documentation\fP @
395.fi
396http://java.sun.com/javase/6/docs/index.html
duke6e45e102007-12-01 00:00:00 +0000397.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700398o
duke6e45e102007-12-01 00:00:00 +0000399.na
400\f2Java Deployment Guide \- Pack200\fP @
401.fi
402http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment\-guide/pack200.html
403.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700404o
405jar(1) \- Java Archive Tool
duke6e45e102007-12-01 00:00:00 +0000406.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700407o
408jarsigner(1) \- JAR Signer tool
409.TP 2
410o
411\f2attributes(5)\fP man page
duke6e45e102007-12-01 00:00:00 +0000412.RE
413
414.LP
415.SH "NOTES"
416.LP
417
418.LP
419.LP
420This command should not be confused with \f2pack(1)\fP. They are distinctly separate products.
421.LP
422.LP
tbell16c34dd2009-05-04 18:28:26 -0700423The Java SE API Specification provided with the JDK is the superseding authority, in case of discrepancies.
424.LP
425
duke6e45e102007-12-01 00:00:00 +0000426.LP
427