blob: f414cdb61703a8b6477405606437cfd82716fce7 [file] [log] [blame]
rgallardb6435452013-11-25 20:19:02 -08001'\" t
2.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
3.\"
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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21.\" or visit www.oracle.com if you need additional information or have any
22.\" questions.
23.\"
24.\" Arch: generic
25.\" Software: JDK 8
26.\" Date: 21 November 2013
27.\" SectDesc: Java Deployment Tools
28.\" Title: pack200.1
29.\"
30.if n .pl 99999
31.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
32.\" -----------------------------------------------------------------
33.\" * Define some portability stuff
34.\" -----------------------------------------------------------------
35.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36.\" http://bugs.debian.org/507673
37.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
38.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39.ie \n(.g .ds Aq \(aq
40.el .ds Aq '
41.\" -----------------------------------------------------------------
42.\" * set default formatting
43.\" -----------------------------------------------------------------
44.\" disable hyphenation
45.nh
46.\" disable justification (adjust text to left margin only)
47.ad l
48.\" -----------------------------------------------------------------
49.\" * MAIN CONTENT STARTS HERE *
50.\" -----------------------------------------------------------------
duke6e45e102007-12-01 00:00:00 +000051
rgallardb6435452013-11-25 20:19:02 -080052.SH NAME
53pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
54.SH SYNOPSIS
55.sp
56.nf
tbell16c34dd2009-05-04 18:28:26 -070057
rgallardb6435452013-11-25 20:19:02 -080058\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
59.fi
60.sp
61Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
62.TP
63\fIoptions\fR
64The command-line options\&. See Options\&.
65.TP
66\fIoutput-file\fR
67Name of the output file\&.
68.TP
69\fIJAR-file\fR
70Name of the input file\&.
71.SH DESCRIPTION
72The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
73.PP
74The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
75.sp
76.nf
77\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
78.fi
79.nf
80\f3\fP
81.fi
82.sp
83.SH OPTIONS
84.TP
85-r, --repack
duke6e45e102007-12-01 00:00:00 +000086.br
rgallardb6435452013-11-25 20:19:02 -080087Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
88.sp
89.nf
90\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
91.fi
92.nf
93\f3pack200 \-\-repack myarchive\&.jar\fP
94.fi
95.nf
96\f3\fP
97.fi
98.sp
tbell16c34dd2009-05-04 18:28:26 -070099
tbell16c34dd2009-05-04 18:28:26 -0700100
rgallardb6435452013-11-25 20:19:02 -0800101The following example preserves the order of files in the input file\&.
102.TP
103-g, --no-gzip
104.br
105Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
106.sp
107.nf
108\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
109.fi
110.nf
111\f3\fP
112.fi
113.sp
tbell16c34dd2009-05-04 18:28:26 -0700114
rgallardb6435452013-11-25 20:19:02 -0800115.TP
116-G, --strip-debug
117.br
118Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
119.TP
120--keep-file-order
121.br
122Preserve the order of files in the input file\&. This is the default behavior\&.
123.TP
124-O, --no-keep-file-order
125.br
126The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
127.TP
128-S\fIvalue\fR , --segment-limit=\fIvalue\fR
129.br
130The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
tbell16c34dd2009-05-04 18:28:26 -0700131
rgallardb6435452013-11-25 20:19:02 -0800132The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
tbell16c34dd2009-05-04 18:28:26 -0700133
rgallardb6435452013-11-25 20:19:02 -0800134The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
135
136A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
137.TP
138-E\fIvalue\fR , --effort=\fIvalue\fR
duke6e45e102007-12-01 00:00:00 +0000139.br
rgallardb6435452013-11-25 20:19:02 -0800140If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command 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\&.
141
142The default is 5, to invest a modest amount of time to produce reasonable compression\&.
143.TP
144-H\fIvalue\fR , --deflate-hint=\fIvalue\fR
duke6e45e102007-12-01 00:00:00 +0000145.br
rgallardb6435452013-11-25 20:19:02 -0800146Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
147
148If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
149
150The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
151.TP
152-m\fIvalue\fR , --modification-time=\fIvalue\fR
duke6e45e102007-12-01 00:00:00 +0000153.br
rgallardb6435452013-11-25 20:19:02 -0800154The possible values are \f3latest\fR and \f3keep\fR\&.
155
156If the value is latest, then the packer attempts 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 is 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\&.
157
158If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
159.TP
160-P\fIfile\fR , --pass-file=\fIfile\fR
duke6e45e102007-12-01 00:00:00 +0000161.br
rgallardb6435452013-11-25 20:19:02 -0800162Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
163.TP
164-U\fIaction\fR , --unknown-attribute=\fIaction\fR
duke6e45e102007-12-01 00:00:00 +0000165.br
rgallardb6435452013-11-25 20:19:02 -0800166Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
167
168If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
169
170If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
171
172If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
173.TP
174.nf
175-C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
duke6e45e102007-12-01 00:00:00 +0000176.br
tbell16c34dd2009-05-04 18:28:26 -0700177.fi
rgallardb6435452013-11-25 20:19:02 -0800178See next option\&.
179.TP
180.nf
181-F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
182.br
duke6e45e102007-12-01 00:00:00 +0000183.fi
rgallardb6435452013-11-25 20:19:02 -0800184See next option\&.
185.TP
186.nf
187-M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
188.br
189.fi
190See next option\&.
191.TP
192.nf
193-D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
194.br
195.fi
196With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
duke6e45e102007-12-01 00:00:00 +0000197
rgallardb6435452013-11-25 20:19:02 -0800198\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
199
200If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
201
202If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
203
204If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
205.TP
206-f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
207.br
208A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
209.sp
210.nf
211\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
212.fi
213.nf
214\f3more pack\&.properties\fP
215.fi
216.nf
217\f3# Generic properties for the packer\&.\fP
218.fi
219.nf
220\f3modification\&.time=latest\fP
221.fi
222.nf
223\f3deflate\&.hint=false\fP
224.fi
225.nf
226\f3keep\&.file\&.order=false\fP
227.fi
228.nf
229\f3# This option will cause the files bearing new attributes to\fP
230.fi
231.nf
232\f3# be reported as an error rather than passed uncompressed\&.\fP
233.fi
234.nf
235\f3unknown\&.attribute=error\fP
236.fi
237.nf
238\f3# Change the segment limit to be unlimited\&.\fP
239.fi
240.nf
241\f3segment\&.limit=\-1\fP
242.fi
243.nf
244\f3\fP
245.fi
246.sp
247
248.TP
249-v, --verbose
250.br
251Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
252.TP
253-q, --quiet
254.br
255Specifies quiet operation with no messages\&.
256.TP
257-l\fIfilename\fR , --log-file=\fIfilename\fR
258.br
259Specifies a log file to output messages\&.
260.TP
261-?, -h, --help
262.br
263Prints help information about this command\&.
264.TP
265-V, --version
266.br
267Prints version information about this command\&.
268.TP
269-J\fIoption\fR
270.br
271Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
272.SH EXIT\ STATUS
273The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
274.SH NOTES
275This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
276.PP
277The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
278.SH SEE\ ALSO
279.TP 0.2i
280\(bu
281unpack200(1)
282.TP 0.2i
283\(bu
284jar(1)
285.TP 0.2i
286\(bu
287jarsigner(1)
288.RE
289.br
290'pl 8.5i
291'bp