blob: 299a96f5a22b5d986c889ee558793f1cfe172c22 [file] [log] [blame]
bpatel87d64cc2010-07-14 15:42:06 -07001." Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
duke6e45e102007-12-01 00:00:00 +00002." 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."
bpatel87d64cc2010-07-14 15:42:06 -070022.TH pack200 1 "02 Jun 2010"
duke6e45e102007-12-01 00:00:00 +000023
24.LP
tbell16c34dd2009-05-04 18:28:26 -070025.SH "Name"
duke6e45e102007-12-01 00:00:00 +000026pack200 \- JAR Packing tool
27.LP
28.SH "SYNOPSIS"
29.LP
30
31.LP
32.LP
33\f4pack200\fP\f2 [ \fP\f2options\fP ] \f2output\-file\fP \f2JAR\-file\fP
34.LP
35.LP
36Options may be in any order. The last option on the command line or in a properties file supersedes all previously specified options.
37.LP
38.RS 3
39
40.LP
tbell16c34dd2009-05-04 18:28:26 -070041.RS 3
duke6e45e102007-12-01 00:00:00 +000042.TP 3
43options
44Command\-line options.
45.TP 3
46output\-file
47Name of the output file.
48.TP 3
49JAR\-file
50Name of the input file.
tbell16c34dd2009-05-04 18:28:26 -070051.RE
52
duke6e45e102007-12-01 00:00:00 +000053.LP
54.RE
55.SH "DESCRIPTION"
56.LP
57
58.LP
59.LP
60The \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.
61.LP
62.LP
63The \f2pack200\fP tool uses several options to fine\-tune and set the compression engine.
64.LP
65.SS
66Typical usage:
67.LP
tbell16c34dd2009-05-04 18:28:26 -070068.RS 3
duke6e45e102007-12-01 00:00:00 +000069
70.LP
71.LP
72\f2% pack200 myarchive.pack.gz myarchive.jar\fP
73.LP
tbell16c34dd2009-05-04 18:28:26 -070074.RE
duke6e45e102007-12-01 00:00:00 +000075.LP
76In this example, \f2myarchive.pack.gz\fP is produced using the default \f2pack200\fP settings.
77.LP
78.SH "OPTIONS"
79.LP
80
81.LP
82.LP
83\f4\-r \-\-repack\fP
84.LP
85.RS 3
86
87.LP
88.LP
89Produces 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.
90.LP
91.RS 3
92
93.LP
94.LP
95\f2% pack200 \-\-repack myarchive\-packer.jar myarchive.jar\fP
96.LP
97.LP
98\f2% pack200 \-\-repack myarchive.jar\fP
99.LP
100.RE
101.RE
102.LP
103\f4\-g \-\-no\-gzip\fP
104.LP
105.RS 3
106
107.LP
108.LP
109Produces a \f2pack200\fP file. With this option a suitable compressor must be used, and the target system must use a corresponding decompresser.
110.LP
111.RS 3
112
113.LP
114.LP
115\f2% pack200 \-\-no\-gzip myarchive.pack myarchive.jar\fP
116.LP
117.RE
118.RE
119.LP
120\f4\-G \-\-strip\-debug\fP
121.LP
122.RS 3
123
124.LP
125.LP
126Strips 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.
127.LP
128.RE
129.LP
130\f4\-O \-\-no\-keep\-file\-order\fP
131.LP
132.RS 3
133
134.LP
135.LP
136The 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.
137.LP
138.RE
139.LP
140\f4\-Svalue \-\-segment\-limit=\fP\f2value\fP
141.LP
142.RS 3
143
144.LP
145.LP
146The value is the estimated target size N (in bytes) of each archive segment. If a single input file requires
147.br
148more 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.
149.LP
150.LP
151The 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.
152.LP
153.LP
154The 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.
155.LP
156.LP
157A 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).
158.LP
159.RE
160.LP
161\f4\-Evalue \-\-effort=\fP\f2value\fP
162.LP
163.RS 3
164
165.LP
166.LP
167If 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.
168.LP
169.LP
170The default is \f25\fP, investing a modest amount of time to produce reasonable compression.
171.LP
172.RE
173.LP
174\f4\-Hvalue \-\-deflate\-hint=\fP\f2value\fP
175.LP
176.RS 3
177
178.LP
179.LP
180Overrides the default, which preserves the input information, but may cause the transmitted archive to be larger. The possible values are:
181.LP
tbell16c34dd2009-05-04 18:28:26 -0700182.RS 3
duke6e45e102007-12-01 00:00:00 +0000183.TP 3
184true
185.TP 3
186false
187In 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 -0700188.RE
189
duke6e45e102007-12-01 00:00:00 +0000190.LP
tbell16c34dd2009-05-04 18:28:26 -0700191.RS 3
duke6e45e102007-12-01 00:00:00 +0000192.TP 3
193keep
194Preserve deflation hints observed in the input JAR. (This is the default.)
tbell16c34dd2009-05-04 18:28:26 -0700195.RE
196
duke6e45e102007-12-01 00:00:00 +0000197.LP
198.RE
199.LP
200\f4\-mvalue \-\-modification\-time=\fP\f2value\fP
201.LP
202.RS 3
203
204.LP
205.LP
206The possible values are:
207.LP
tbell16c34dd2009-05-04 18:28:26 -0700208.RS 3
duke6e45e102007-12-01 00:00:00 +0000209.TP 3
210latest
211The 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.
212.TP 3
213keep
214Preserves modification times observed in the input JAR. (This is the default.)
tbell16c34dd2009-05-04 18:28:26 -0700215.RE
216
duke6e45e102007-12-01 00:00:00 +0000217.LP
218.RE
219.LP
220\f4\-Pfile \-\-pass\-file=\fP\f2file\fP
221.LP
222.RS 3
223
224.LP
225.LP
226Indicates 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.
227.LP
228.RE
229.LP
230\f4\-Uaction \-\-unknown\-attribute=\fP\f2action\fP
231.LP
232.RS 3
233
234.LP
235.LP
236Overrides 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:
237.LP
tbell16c34dd2009-05-04 18:28:26 -0700238.RS 3
duke6e45e102007-12-01 00:00:00 +0000239.TP 3
240error
241The \f2pack200\fP operation as a whole will fail with a suitable explanation.
242.TP 3
243strip
244The attribute will be dropped. Note: Removing the required VM attributes may cause Class Loader failures.
245.TP 3
246pass
247Upon encountering this attribute, the entire class will be transmitted as though it is a resource.
tbell16c34dd2009-05-04 18:28:26 -0700248.RE
249
duke6e45e102007-12-01 00:00:00 +0000250.LP
251.RE
252.LP
253\f4\-Cattribute\-name=\fP\f2layout\fP \f3\-\-class\-attribute=\fP\f2attribute\-name=action\fP
254.br
tbell16c34dd2009-05-04 18:28:26 -0700255\f4\-Fattribute\-name=\fP\f2layout\fP \f3\-\-field\-attribute=\fP\f2attribute\-name=action\fP
duke6e45e102007-12-01 00:00:00 +0000256.br
tbell16c34dd2009-05-04 18:28:26 -0700257\f4\-Mattribute\-name=\fP\f2layout\fP \f3\-\-method\-attribute=\fP\f2attribute\-name=action\fP
duke6e45e102007-12-01 00:00:00 +0000258.br
tbell16c34dd2009-05-04 18:28:26 -0700259\f4\-Dattribute\-name=\fP\f2layout\fP \f3\-\-code\-attribute=\fP\f2attribute\-name=action\fP
duke6e45e102007-12-01 00:00:00 +0000260.LP
261.RS 3
262
263.LP
264.LP
265With 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:
266.LP
tbell16c34dd2009-05-04 18:28:26 -0700267.RS 3
duke6e45e102007-12-01 00:00:00 +0000268.TP 3
269some\-layout\-string
270The layout language is defined in the JSR 200 specification.
271.LP
272Example: \f2\-\-class\-attribute=SourceFile=RUH\fP
273.TP 3
274error
275Upon encountering this attribute, the pack200 operation will fail with a suitable explanation.
276.TP 3
277strip
278Upon 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 -0700279.RE
280
duke6e45e102007-12-01 00:00:00 +0000281.LP
282.LP
283Example: \f2\-\-class\-attribute=CompilationID=pass\fP will cause the class file containing this attribute to be passed through without further action by the packer.
284.LP
285.RE
286.LP
287\f4\-f\fP\f2 \fP\f2pack.properties\fP \f3\-\-config\-file=\fP\f2pack.properties\fP
288.LP
289.RS 3
290
291.LP
292.LP
293A configuration file, containing Java properties to initialize the packer, may be specified on the command line.
294.LP
295.RS 3
296
297.LP
298.LP
299\f2% pack200 \-f pack.properties myarchive.pack.gz myarchive.jar\fP
300.br
301\f2% more pack.properties\fP
302.br
303\f2# Generic properties for the packer.\fP
304.br
305\f2modification.time=latest\fP
306.br
307\f2deflate.hint=false\fP
308.br
309\f2keep.file.order=false\fP
310.br
311\f2# This option will cause the files bearing new attributes to\fP
312.br
313\f2# be reported as an error rather than passed uncompressed.\fP
314.br
315\f2unknown.attribute=error\fP
316.br
317\f2# Change the segment limit to be unlimited.\fP
318.br
319\f2segment.limit=\-1\fP
320.LP
321.RE
322.RE
323.RS 3
324
325.LP
326.LP
327\f4\-v \-\-verbose\fP
328.LP
329.RS 3
330
331.LP
332.LP
333Outputs minimal messages. Multiple specification of this option will output more verbose messages.
334.LP
335.RE
336.LP
337\f4\-q \-\-quiet\fP
338.LP
339.RS 3
340
341.LP
342.LP
343Specifies quiet operation with no messages.
344.LP
345.RE
346.LP
347\f4\-lfilename \-\-log\-file=\fP\f2filename\fP
348.LP
349.RS 3
350
351.LP
352.LP
353Specifies a log file to output messages.
354.LP
355.RE
356.LP
357\f4\-Joption\fP
358.LP
359.RS 3
360
361.LP
362.LP
363Passes 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.
364.LP
365.RE
366.RE
367.SH "EXIT STATUS"
368.LP
369
370.LP
371.LP
372The following exit values are returned:
373.LP
374.RS 3
375
376.LP
377.LP
378\f2\ 0\fP for successful completion;
379.LP
380.LP
381\f2>0\fP if an error occurs.
382.LP
383.RE
384.SH "SEE ALSO"
385.LP
386.RS 3
387.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700388o
389unpack200(1)
duke6e45e102007-12-01 00:00:00 +0000390.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700391o
392.na
393\f2Java SE Documentation\fP @
394.fi
395http://java.sun.com/javase/6/docs/index.html
duke6e45e102007-12-01 00:00:00 +0000396.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700397o
duke6e45e102007-12-01 00:00:00 +0000398.na
399\f2Java Deployment Guide \- Pack200\fP @
400.fi
401http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment\-guide/pack200.html
402.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700403o
404jar(1) \- Java Archive Tool
duke6e45e102007-12-01 00:00:00 +0000405.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700406o
407jarsigner(1) \- JAR Signer tool
408.TP 2
409o
410\f2attributes(5)\fP man page
duke6e45e102007-12-01 00:00:00 +0000411.RE
412
413.LP
414.SH "NOTES"
415.LP
416
417.LP
418.LP
419This command should not be confused with \f2pack(1)\fP. They are distinctly separate products.
420.LP
421.LP
tbell16c34dd2009-05-04 18:28:26 -0700422The Java SE API Specification provided with the JDK is the superseding authority, in case of discrepancies.
423.LP
duke6e45e102007-12-01 00:00:00 +0000424