|
1 .'" t |
|
2 ." |
|
3 ." Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. |
|
4 ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 ." |
|
6 ." This code is free software; you can redistribute it and/or modify it |
|
7 ." under the terms of the GNU General Public License version 2 only, as |
|
8 ." published by the Free Software Foundation. |
|
9 ." |
|
10 ." This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 ." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 ." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 ." version 2 for more details (a copy is included in the LICENSE file that |
|
14 ." accompanied this code). |
|
15 ." |
|
16 ." You should have received a copy of the GNU General Public License version |
|
17 ." 2 along with this work; if not, write to the Free Software Foundation, |
|
18 ." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 ." |
|
20 ." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
21 ." CA 95054 USA or visit www.sun.com if you need additional information or |
|
22 ." have any questions. |
|
23 ." |
|
24 ." ` |
|
25 .TH pack200 1 "05 Aug 2006" |
|
26 ." Generated by html2roff |
|
27 |
|
28 .LP |
|
29 .SH NAME |
|
30 pack200 \- JAR Packing tool |
|
31 .LP |
|
32 .SH "SYNOPSIS" |
|
33 .LP |
|
34 |
|
35 .LP |
|
36 .LP |
|
37 \f4pack200\fP\f2 [ \fP\f2options\fP ] \f2output\-file\fP \f2JAR\-file\fP |
|
38 .LP |
|
39 .LP |
|
40 Options may be in any order. The last option on the command line or in a properties file supersedes all previously specified options. |
|
41 .LP |
|
42 .RS 3 |
|
43 |
|
44 .LP |
|
45 .TP 3 |
|
46 options |
|
47 Command\-line options. |
|
48 .TP 3 |
|
49 output\-file |
|
50 Name of the output file. |
|
51 .TP 3 |
|
52 JAR\-file |
|
53 Name of the input file. |
|
54 .LP |
|
55 .RE |
|
56 .SH "DESCRIPTION" |
|
57 .LP |
|
58 |
|
59 .LP |
|
60 .LP |
|
61 The \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 |
|
64 The \f2pack200\fP tool uses several options to fine\-tune and set the compression engine. |
|
65 .LP |
|
66 .SS |
|
67 Typical usage: |
|
68 .LP |
|
69 |
|
70 .LP |
|
71 .LP |
|
72 \f2% pack200 myarchive.pack.gz myarchive.jar\fP |
|
73 .LP |
|
74 .LP |
|
75 In this example, \f2myarchive.pack.gz\fP is produced using the default \f2pack200\fP settings. |
|
76 .LP |
|
77 .SH "OPTIONS" |
|
78 .LP |
|
79 |
|
80 .LP |
|
81 .LP |
|
82 \f4\-r \-\-repack\fP |
|
83 .LP |
|
84 .RS 3 |
|
85 |
|
86 .LP |
|
87 .LP |
|
88 Produces 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. |
|
89 .LP |
|
90 .RS 3 |
|
91 |
|
92 .LP |
|
93 .LP |
|
94 \f2% pack200 \-\-repack myarchive\-packer.jar myarchive.jar\fP |
|
95 .LP |
|
96 .LP |
|
97 \f2% pack200 \-\-repack myarchive.jar\fP |
|
98 .LP |
|
99 .RE |
|
100 .RE |
|
101 .LP |
|
102 \f4\-g \-\-no\-gzip\fP |
|
103 .LP |
|
104 .RS 3 |
|
105 |
|
106 .LP |
|
107 .LP |
|
108 Produces a \f2pack200\fP file. With this option a suitable compressor must be used, and the target system must use a corresponding decompresser. |
|
109 .LP |
|
110 .RS 3 |
|
111 |
|
112 .LP |
|
113 .LP |
|
114 \f2% pack200 \-\-no\-gzip myarchive.pack myarchive.jar\fP |
|
115 .LP |
|
116 .RE |
|
117 .RE |
|
118 .LP |
|
119 \f4\-G \-\-strip\-debug\fP |
|
120 .LP |
|
121 .RS 3 |
|
122 |
|
123 .LP |
|
124 .LP |
|
125 Strips 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. |
|
126 .LP |
|
127 .RE |
|
128 .LP |
|
129 \f4\-O \-\-no\-keep\-file\-order\fP |
|
130 .LP |
|
131 .RS 3 |
|
132 |
|
133 .LP |
|
134 .LP |
|
135 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. |
|
136 .LP |
|
137 .RE |
|
138 .LP |
|
139 \f4\-Svalue \-\-segment\-limit=\fP\f2value\fP |
|
140 .LP |
|
141 .RS 3 |
|
142 |
|
143 .LP |
|
144 .LP |
|
145 The value is the estimated target size N (in bytes) of each archive segment. If a single input file requires |
|
146 .br |
|
147 more 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. |
|
148 .LP |
|
149 .LP |
|
150 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. |
|
151 .LP |
|
152 .LP |
|
153 The 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. |
|
154 .LP |
|
155 .LP |
|
156 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). |
|
157 .LP |
|
158 .RE |
|
159 .LP |
|
160 \f4\-Evalue \-\-effort=\fP\f2value\fP |
|
161 .LP |
|
162 .RS 3 |
|
163 |
|
164 .LP |
|
165 .LP |
|
166 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\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. |
|
167 .LP |
|
168 .LP |
|
169 The default is \f25\fP, investing a modest amount of time to produce reasonable compression. |
|
170 .LP |
|
171 .RE |
|
172 .LP |
|
173 \f4\-Hvalue \-\-deflate\-hint=\fP\f2value\fP |
|
174 .LP |
|
175 .RS 3 |
|
176 |
|
177 .LP |
|
178 .LP |
|
179 Overrides the default, which preserves the input information, but may cause the transmitted archive to be larger. The possible values are: |
|
180 .LP |
|
181 .TP 3 |
|
182 true |
|
183 .TP 3 |
|
184 false |
|
185 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. |
|
186 .LP |
|
187 .TP 3 |
|
188 keep |
|
189 Preserve deflation hints observed in the input JAR. (This is the default.) |
|
190 .LP |
|
191 .RE |
|
192 .LP |
|
193 \f4\-mvalue \-\-modification\-time=\fP\f2value\fP |
|
194 .LP |
|
195 .RS 3 |
|
196 |
|
197 .LP |
|
198 .LP |
|
199 The possible values are: |
|
200 .LP |
|
201 .TP 3 |
|
202 latest |
|
203 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. |
|
204 .TP 3 |
|
205 keep |
|
206 Preserves modification times observed in the input JAR. (This is the default.) |
|
207 .LP |
|
208 .RE |
|
209 .LP |
|
210 \f4\-Pfile \-\-pass\-file=\fP\f2file\fP |
|
211 .LP |
|
212 .RS 3 |
|
213 |
|
214 .LP |
|
215 .LP |
|
216 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/\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. |
|
217 .LP |
|
218 .RE |
|
219 .LP |
|
220 \f4\-Uaction \-\-unknown\-attribute=\fP\f2action\fP |
|
221 .LP |
|
222 .RS 3 |
|
223 |
|
224 .LP |
|
225 .LP |
|
226 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: |
|
227 .LP |
|
228 .TP 3 |
|
229 error |
|
230 The \f2pack200\fP operation as a whole will fail with a suitable explanation. |
|
231 .TP 3 |
|
232 strip |
|
233 The attribute will be dropped. Note: Removing the required VM attributes may cause Class Loader failures. |
|
234 .TP 3 |
|
235 pass |
|
236 Upon encountering this attribute, the entire class will be transmitted as though it is a resource. |
|
237 .LP |
|
238 .RE |
|
239 .LP |
|
240 \f4\-Cattribute\-name=\fP\f2layout\fP \f3\-\-class\-attribute=\fP\f2attribute\-name=action\fP |
|
241 .br |
|
242 \f4\-Fattribute\-name=\fP\f2layout\fP \f3\-\-field\-attribute=\fP\f2attribute\-name=action\fP |
|
243 .br |
|
244 \f4\-Mattribute\-name=\fP\f2layout\fP \f3\-\-method\-attribute=\fP\f2attribute\-name=action\fP |
|
245 .br |
|
246 \f4\-Dattribute\-name=\fP\f2layout\fP \f3\-\-code\-attribute=\fP\f2attribute\-name=action\fP |
|
247 .LP |
|
248 .RS 3 |
|
249 |
|
250 .LP |
|
251 .LP |
|
252 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: |
|
253 .LP |
|
254 .TP 3 |
|
255 some\-layout\-string |
|
256 The layout language is defined in the JSR 200 specification. |
|
257 .LP |
|
258 Example: \f2\-\-class\-attribute=SourceFile=RUH\fP |
|
259 .TP 3 |
|
260 error |
|
261 Upon encountering this attribute, the pack200 operation will fail with a suitable explanation. |
|
262 .TP 3 |
|
263 strip |
|
264 Upon encountering this attribute, the attribute will be removed from the output. Note: removing VM\-required attributes may cause Class Loader failures. |
|
265 .LP |
|
266 .LP |
|
267 Example: \f2\-\-class\-attribute=CompilationID=pass\fP will cause the class file containing this attribute to be passed through without further action by the packer. |
|
268 .LP |
|
269 .RE |
|
270 .LP |
|
271 \f4\-f\fP\f2 \fP\f2pack.properties\fP \f3\-\-config\-file=\fP\f2pack.properties\fP |
|
272 .LP |
|
273 .RS 3 |
|
274 |
|
275 .LP |
|
276 .LP |
|
277 A configuration file, containing Java properties to initialize the packer, may be specified on the command line. |
|
278 .LP |
|
279 .RS 3 |
|
280 |
|
281 .LP |
|
282 .LP |
|
283 \f2% pack200 \-f pack.properties myarchive.pack.gz myarchive.jar\fP |
|
284 .br |
|
285 \f2% more pack.properties\fP |
|
286 .br |
|
287 \f2# Generic properties for the packer.\fP |
|
288 .br |
|
289 \f2modification.time=latest\fP |
|
290 .br |
|
291 \f2deflate.hint=false\fP |
|
292 .br |
|
293 \f2keep.file.order=false\fP |
|
294 .br |
|
295 \f2# This option will cause the files bearing new attributes to\fP |
|
296 .br |
|
297 \f2# be reported as an error rather than passed uncompressed.\fP |
|
298 .br |
|
299 \f2unknown.attribute=error\fP |
|
300 .br |
|
301 \f2# Change the segment limit to be unlimited.\fP |
|
302 .br |
|
303 \f2segment.limit=\-1\fP |
|
304 .LP |
|
305 .RE |
|
306 .RE |
|
307 .RS 3 |
|
308 |
|
309 .LP |
|
310 .LP |
|
311 \f4\-v \-\-verbose\fP |
|
312 .LP |
|
313 .RS 3 |
|
314 |
|
315 .LP |
|
316 .LP |
|
317 Outputs minimal messages. Multiple specification of this option will output more verbose messages. |
|
318 .LP |
|
319 .RE |
|
320 .LP |
|
321 \f4\-q \-\-quiet\fP |
|
322 .LP |
|
323 .RS 3 |
|
324 |
|
325 .LP |
|
326 .LP |
|
327 Specifies quiet operation with no messages. |
|
328 .LP |
|
329 .RE |
|
330 .LP |
|
331 \f4\-lfilename \-\-log\-file=\fP\f2filename\fP |
|
332 .LP |
|
333 .RS 3 |
|
334 |
|
335 .LP |
|
336 .LP |
|
337 Specifies a log file to output messages. |
|
338 .LP |
|
339 .RE |
|
340 .LP |
|
341 \f4\-Joption\fP |
|
342 .LP |
|
343 .RS 3 |
|
344 |
|
345 .LP |
|
346 .LP |
|
347 Passes 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. |
|
348 .LP |
|
349 .RE |
|
350 .RE |
|
351 .SH "EXIT STATUS" |
|
352 .LP |
|
353 |
|
354 .LP |
|
355 .LP |
|
356 The following exit values are returned: |
|
357 .LP |
|
358 .RS 3 |
|
359 |
|
360 .LP |
|
361 .LP |
|
362 \f2\ 0\fP for successful completion; |
|
363 .LP |
|
364 .LP |
|
365 \f2>0\fP if an error occurs. |
|
366 .LP |
|
367 .RE |
|
368 .SH "SEE ALSO" |
|
369 .LP |
|
370 .RS 3 |
|
371 .TP 2 |
|
372 * |
|
373 unpack200 \- JAR Unpacking Tool |
|
374 .TP 2 |
|
375 * |
|
376 \f2unpack200(1)\fP, \f2jar(1)\fP, \f2jarsigner(1)\fP, \f2attributes(5)\fP man pages |
|
377 .TP 2 |
|
378 * |
|
379 Java SE Documentation |
|
380 .TP 2 |
|
381 * |
|
382 .na |
|
383 \f2Java Deployment Guide \- Pack200\fP @ |
|
384 .fi |
|
385 http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment\-guide/pack200.html |
|
386 .TP 2 |
|
387 * |
|
388 \f2jar\fP \- Java Archive Tool |
|
389 .TP 2 |
|
390 * |
|
391 .na |
|
392 \f2jarsigner\fP \- JAR Signer tool @ |
|
393 .fi |
|
394 http://java.sun.com/javase/6/docs/technotes/tools/solaris/jarsigner.html |
|
395 .RE |
|
396 |
|
397 .LP |
|
398 .SH "NOTES" |
|
399 .LP |
|
400 |
|
401 .LP |
|
402 .LP |
|
403 This command should not be confused with \f2pack(1)\fP. They are distinctly separate products. |
|
404 .LP |
|
405 .LP |
|
406 The Java SE API Specification provided with the SDK is the superseding authority, in case of discrepancies. |
|
407 .LP |
|
408 |