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