blob: 69d474e0c4d5dadf7569770f908ccf2a31248f11 [file] [log] [blame]
tbell16c34dd2009-05-04 18:28:26 -07001." Copyright 2004-2006 Sun Microsystems, Inc. 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.
duke6e45e102007-12-01 00:00:00 +000021."
tbell16c34dd2009-05-04 18:28:26 -070022.TH jar 1 "04 May 2009"
23." Generated from HTML by html2man (author: Eric Armstrong)
24
duke6e45e102007-12-01 00:00:00 +000025.LP
tbell16c34dd2009-05-04 18:28:26 -070026.SH "Name"
duke6e45e102007-12-01 00:00:00 +000027jar\-The Java Archive Tool
28.LP
29\f3jar\fP combines multiple files into a single JAR archive file.
30.SH "SYNOPSIS"
31.LP
32
33.LP
tbell16c34dd2009-05-04 18:28:26 -070034.RS 3
duke6e45e102007-12-01 00:00:00 +000035.TP 3
36Create jar file
37\f4jar c\fP\f2[v0Mmfe] [\fP\f2manifest\fP\f2] [\fP\f2jarfile\fP\f2] [\fP\f2entrypoint\fP\f2] [\-C\fP \f2dir\fP\f2]\fP \f2inputfiles\fP \f2[\-J\fP\f2option\fP\f2]\fP
38.TP 3
39Update jar file
40\f4jar u\fP\f2[v0Mmfe] [\fP\f2manifest\fP\f2] [\fP\f2jarfile\fP\f2] [\fP\f2entrypoint\fP\f2] [\-C\fP \f2dir\fP\f2]\fP \f2inputfiles\fP \f2[\-J\fP\f2option\fP\f2]\fP
41.TP 3
42Extract jar file
43\f4jar x\fP\f2[vf] [\fP\f2jarfile\fP\f2] [\fP\f2inputfiles\fP\f2] [\-J\fP\f2option\fP\f2]\fP
44.TP 3
45List table of contents of jar file
46\f4jar t\fP\f2[vf] [\fP\f2jarfile\fP\f2] [\fP\f2inputfiles\fP\f2] [\-J\fP\f2option\fP\f2]\fP
47.TP 3
48Add index to jar file
49\f4jar i\fP \f2jarfile\fP \f2[\-J\fP\f2option\fP\f2]\fP
tbell16c34dd2009-05-04 18:28:26 -070050.RE
51
duke6e45e102007-12-01 00:00:00 +000052.LP
53.LP
54where:
55.LP
56.RS 3
57
58.LP
tbell16c34dd2009-05-04 18:28:26 -070059.RS 3
duke6e45e102007-12-01 00:00:00 +000060.TP 3
61cuxtiv0Mmfe
62Options that control the \f2jar\fP command.
63.TP 3
tbell16c34dd2009-05-04 18:28:26 -070064jarfile
duke6e45e102007-12-01 00:00:00 +000065Jar file to be created (\f2c\fP), updated (\f2u\fP), extracted (\f2x\fP), or have its table of contents viewed (\f2t\fP). The \f2\-f\fP option and filename \f2jarfile\fP are a pair \-\- if either is present, they must both appear. Note that omitting \f2f\fP and \f2jarfile\fP accepts a "jar file" from standard input (for x and t) or sends the "jar file" to standard output (for c and u).
66.TP 3
duke6e45e102007-12-01 00:00:00 +000067inputfiles
68Files or directories, separated by spaces, to be combined into \f2jarfile\fP (for c and u), or to be extracted (for x) or listed (for t) from \f2jarfile\fP. All directories are processed recursively. The files are compressed unless option \f20\fP (zero) is used.
69.TP 3
tbell16c34dd2009-05-04 18:28:26 -070070manifest
duke6e45e102007-12-01 00:00:00 +000071Pre\-existing manifest file whose \f2name\fP\f2:\fP \f2value\fP pairs are to be included in MANIFEST.MF in the jar file. The \f2\-m\fP option and filename \f2manifest\fP are a pair \-\- if either is present, they must both appear. The letters \f3m\fP, \f3f\fP and \f3e\fP must appear in the same order that \f2manifest\fP, \f2jarfile\fP, \f2entrypoint\fP appear.
72.TP 3
duke6e45e102007-12-01 00:00:00 +000073entrypoint
74The name of the class that set as the application entry point for stand\-alone applications bundled into executable jar file. The \f2\-e\fP option and entrypoint are a pair \-\- if either is present, they must both appear. The letters \f3m\fP, \f3f\fP and \f3e\fP must appear in the same order that \f2manifest\fP, \f2jarfile\fP, \f2entrypoint\fP appear.
75.TP 3
76\-C\ dir
77Temporarily changes directories to \f2dir\fP while processing the following \f2inputfiles\fP argument. Multiple \f2\-C\ \fP\f2dir\fP \f2inputfiles\fP sets are allowed.
78.TP 3
79\-Joption
80Option to be passed into the Java runtime environment. (There must be no space between \f2\-J\fP and \f2option\fP).
tbell16c34dd2009-05-04 18:28:26 -070081.RE
82
duke6e45e102007-12-01 00:00:00 +000083.LP
84.RE
85.SH "DESCRIPTION"
86.LP
87
88.LP
89The \f3jar\fP tool combines multiple files into a single JAR archive file. \f3jar\fP is a general\-purpose archiving and compression tool, based on ZIP and the
90.na
91\f2ZLIB\fP @
92.fi
tbell16c34dd2009-05-04 18:28:26 -070093http://www.gzip.org/zlib/ compression format. However, \f3jar\fP was designed mainly package java applets or applications into a single archive. When the components of an applet or application (files, images and sounds) are combined into a single archive, they can be downloaded by a java agent (like a browser) in a single HTTP transaction, rather than requiring a new connection for each piece. This dramatically improves download times. \f3jar\fP also compresses files and so further improves download time. In addition, it allows individual entries in a file to be signed by the applet author so that their origin can be authenticated. The syntax for the jar tool is almost identical to the syntax for the \f2tar\fP command. A \f3jar\fP archive can be used as a class path entry, whether or not it is compressed.
duke6e45e102007-12-01 00:00:00 +000094.LP
95Typical usage to combine files into a jar file is:
96.LP
97.RS 3
98
99.LP
100.nf
101\f3
102.fl
103% jar cf myFile.jar *.class
104.fl
105\fP
106.fi
107.RE
108
109.LP
110In this example, all the class files in the current directory are placed into the file named \f2myFile.jar\fP. The jar tool automatically generates a manifest file entry named \f2META\-INF/MANIFEST.MF\fP. It is always the first entry in the jar file. The manifest file declares meta\-information about the archive, and stores that data as \f2name\ :\ value\fP pairs. Refer to the
111.na
112\f2JAR file specification\fP @
113.fi
tbell16c34dd2009-05-04 18:28:26 -0700114http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest for details explaining how the jar tool stores meta\-information in the manifest file.
duke6e45e102007-12-01 00:00:00 +0000115.LP
116If a jar file should include \f2name\ :\ value\fP pairs contained in an existing manifest file, specify that file using the \f2\-m\fP option:
117.LP
118.RS 3
119
120.LP
121.nf
122\f3
123.fl
124% jar cmf myManifestFile myFile.jar *.class
125.fl
126\fP
127.fi
128.RE
129
130.LP
131An existing manifest file must end with a new line character.\ \f3jar\fP does not parse the last line of a manifest file if it does not end with a new line character.
132.br
133
134.LP
135.br
136
137.LP
138\f3Note:\ \fP A jar command that specifies \f2cfm\fP on the command line instead of \f2cmf\fP (the order of the m and \-f options are reversed), the \f3jar\fP command line must specify the name of the jar archive first, followed by the name of the manifest file:
139.RS 3
140
141.LP
142.nf
143\f3
144.fl
145% jar cfm myFile.jar myManifestFile *.class
146.fl
147\fP
148.fi
149.RE
150
151.LP
152The manifest is in a text format inspired by RFC822 ASCII format, so it is easy to view and process manifest\-file contents.
153.LP
154To extract the files from a jar file, use \f2x\fP:
155.LP
156.RS 3
157
158.LP
159.nf
160\f3
161.fl
162% jar xf myFile.jar
163.fl
164\fP
165.fi
166.RE
167
168.LP
169.LP
170To extract individual files from a jar file, supply their filenames:
171.LP
172.RS 3
173
174.LP
175.nf
176\f3
177.fl
178% jar xf myFile.jar foo bar
179.fl
180\fP
181.fi
182.RE
183
184.LP
185.LP
186Beginning with version 1.3 of the Java 2 SDK, the \f2jar\fP utility supports
187.na
188\f2JarIndex\fP @
189.fi
tbell16c34dd2009-05-04 18:28:26 -0700190http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Index, which allows application class loaders to load classes more efficiently from jar files. If an application or applet is bundled into multiple jar files,\ only the necessary jar files will be downloaded and opened to load classes. This performance optimization is enabled by running \f2jar\fP with the \f2\-i\fPoption. It will generate package location information for the specified main jar file and all the jar files it depends on, which need to be specified in the \f2Class\-Path\fP attribute of the main jar file's manifest.
duke6e45e102007-12-01 00:00:00 +0000191.LP
192.RS 3
193
194.LP
195.nf
196\f3
197.fl
198% jar i main.jar
199.fl
200\fP
201.fi
202.RE
203
204.LP
205.LP
206In this example, an \f2INDEX.LIST\fP file is inserted into the \f2META\-INF\fP directory of \f2main.jar\fP.
207.br
208.br
209The application class loader uses the information stored in this file for efficient class loading.\ For details about how location information is stored in the index file, refer to the \f2JarIndex\fP specification.
210.br
211.br
212To copy directories, first compress files in \f2dir1\fP to \f2stdout\fP, then extract from \f2stdin\fP to \f2dir2\fP (omitting the \f2\-f\fP option from both \f2jar\fP commands):
213.LP
214.RS 3
215
216.LP
217.nf
218\f3
219.fl
220% (cd dir1; jar c .) | (cd dir2; jar x)
221.fl
222\fP
223.fi
224.RE
225
226.LP
227.LP
228To review command samples which use \f2jar\fP to opeate on jar files and jar file manifests, see Examples, below. Also refer to the jar trail of the
229.na
230\f2Java Tutorial\fP @
231.fi
232http://java.sun.com/docs/books/tutorial/jar.
233.LP
234.SH "OPTIONS"
235.LP
236
237.LP
tbell16c34dd2009-05-04 18:28:26 -0700238.RS 3
duke6e45e102007-12-01 00:00:00 +0000239.TP 3
240c
241Creates a new archive file named \f2jarfile\fP (if \f2f\fP is specified) or to standard output (if \f2f\fP and \f2jarfile\fP are omitted). Add to it the files and directories specified by \f2inputfiles\fP.
242.TP 3
243u
244Updates an existing file \f2jarfile\fP (when \f2f\fP is specified) by adding to it files and directories specified by \f2inputfiles\fP. For example:
245.RS 3
246
247.LP
248.nf
249\f3
250.fl
251jar uf foo.jar foo.class
252.fl
253\fP
254.fi
255.RE
256would add the file \f2foo.class\fP to the existing jar file \f2foo.jar\fP. The \f2\-u\fP option can also update the manifest entry, as given by this example:
257.RS 3
258
259.LP
260.nf
261\f3
262.fl
263jar umf manifest foo.jar
264.fl
265\fP
266.fi
267.RE
268updates the \f2foo.jar\fP manifest with the \f2name : value\fP pairs in \f2manifest\fP.
269.TP 3
270x
271Extracts files and directories from \f2jarfile\fP (if \f2f\fP is specified) or standard input (if \f2f\fP and \f2jarfile\fP are omitted). If \f2inputfiles\fP is specified, only those specified files and directories are extracted. Otherwise, all files and directories are extracted. The time and date of the extracted files are those given in the archive.
272.TP 3
273t
274Lists the table of contents from \f2jarfile\fP (if \f2f\fP is specified) or standard input (if \f2f\fP and \f2jarfile\fP are omitted). If \f2inputfiles\fP is specified, only those specified files and directories are listed. Otherwise, all files and directories are listed.
275.TP 3
276i
277Generate index information for the specified \f2jarfile\fP and its dependent jar files. For example:
278.RS 3
279
280.LP
281.nf
282\f3
283.fl
284jar i foo.jar
285.fl
286\fP
287.fi
288.RE
289.LP
290would generate an \f2INDEX.LIST\fP file in \f2foo.jar\fP which contains location information for each package in \f2foo.jar\fP and all the jar files specified in the \f2Class\-Path\fP attribute of \f2foo.jar\fP. See the index example.
291.TP 3
292f
293Specifies the file \f2jarfile\fP to be created (\f2c\fP), updated (\f2u\fP), extracted (\f2x\fP), indexed (\f2i\fP), or viewed (\f2t\fP). The \f2\-f\fP option and filename \f2jarfile\fP are a pair \-\- if present, they must both appear. Omitting \f2f\fP and \f2jarfile\fP accepts a jar file name from \f2stdin\fP(for x and t) or sends jar file to \f2stdout\fP (for c and u).
294.TP 3
295v
296Generates verbose output to standard output. Examples shown below.
297.TP 3
2980
299(zero) Store without using ZIP compression.
300.TP 3
301M
302Do not create a manifest file entry (for c and u), or delete a manifest file entry if one exists (for u).
303.TP 3
304m
305Includes \f2name : value\fP attribute pairs from the specified manifest file \f2manifest\fP in the file at \f2META\-INF/MANIFEST.MF\fP. \f2jar\fP adds a \f2name\ :\ value\fP pair unless an entry already exists with the same name, in which case \f2jar\fP updates its value.
306.LP
307On the command line, the letters \f3m\fP and \f3f\fP must appear in the same order that \f2manifest\fP and \f2jarfile\fP appear. Example use:
308.RS 3
309
310.LP
311.nf
312\f3
313.fl
314jar cmf myManifestFile myFile.jar *.class
315.fl
316\fP
317.fi
318.RE
319You can add special\-purpose \f2name\ :\ value\fP attribute pairs to the manifest that aren't contained in the default manifest. For example, you can add attributes specifying vendor information, version information, package sealing, or to make JAR\-bundled applications executable. See the
320.na
321\f2JAR Files\fP @
322.fi
323http://java.sun.com/docs/books/tutorial/jar/ trail in the Java Tutorial for examples of using the \f4\-m\fP option.
tbell16c34dd2009-05-04 18:28:26 -0700324.LP
duke6e45e102007-12-01 00:00:00 +0000325.TP 3
326e
327Sets \f2entrypoint\fP as the application entry point for stand\-alone applications bundled into executable jar file. The use of this option creates or overrides the \f2Main\-Class\fP attribute value in the manifest file. This option can be used during creation of jar file or while updating the jar file. This option specifies the application entry point without editing or creating the manifest file.
328.br
329.br
330For example, this command creates \f2Main.jar\fP where the \f2Main\-Class\fP attribute value in the manifest is set to \f2Main\fP:
331.RS 3
332
333.LP
334.nf
335\f3
336.fl
337jar cfe Main.jar Main Main.class
338.fl
339\fP
340.fi
341.RE
342.LP
343The java runtime can directly invoke this application by running the following command:
344.RS 3
345
346.LP
347.nf
348\f3
349.fl
350java \-jar Main.jar
351.fl
352\fP
353.fi
354.RE
355If the entrypoint class name is in a package it may use either a dot (".") or slash ("/") character as the delimiter. For example, if \f2Main.class\fP is in a package called \f2foo\fP the entry point can be specified in the following ways:
356.RS 3
357
358.LP
359.nf
360\f3
361.fl
362jar \-cfe Main.jar foo/Main foo/Main.class
363.fl
364\fP
365.fi
366.RE
367or
368.RS 3
369
370.LP
371.nf
372\f3
373.fl
374jar \-cfe Main.jar foo.Main foo/Main.class
375.fl
376\fP
377.fi
378.RE
379\f3Note:\ \fP specifying both \f2\-m\fP and \f2\-e\fP options together when the given manifest also contains the \f2Main\-Class\fP attribute results in an ambigous \f2Main.class\fP specification, leading to an error and the jar creation or update operation is aborted.
380.LP
381.TP 3
382\-C \ dir
383Temporarily changes directories (\f2cd\fP\ \f2dir\fP) during execution of the \f2jar\fP command while processing the following \f2inputfiles\fP argument. Its operation is intended to be similar to the \f2\-C\fP option of the UNIX \f2tar\fP utility.
384.br
385.br
386For example, this command changes to the \f2classes\fP directory and adds the \f2bar.class\fP from that directory to \f2foo.jar\fP:
387.RS 3
388
389.LP
390.nf
391\f3
392.fl
393jar uf foo.jar \-C classes bar.class
394.fl
395\fP
396.fi
397.RE
398This command changes to the \f2classes\fP directory and adds to \f2foo.jar\fP all files within the \f2classes\fP directory (without creating a classes directory in the jar file), then changes back to the original directory before changing to the \f2bin\fP directory to add \f2xyz.class\fP to \f2foo.jar\fP.
399.RS 3
400
401.LP
402.nf
403\f3
404.fl
405jar uf foo.jar \-C classes . \-C bin xyz.class
406.fl
407\fP
408.fi
409.RE
410If \f2classes\fP holds files \f2bar1\fP and \f2bar2\fP, then here's what the jar file will contain using \f2jar tf foo.jar\fP:
411.RS 3
412
413.LP
414.nf
415\f3
416.fl
417META\-INF/
418.fl
419META\-INF/MANIFEST.MF
420.fl
421bar1
422.fl
423bar2
424.fl
425xyz.class
426.fl
427\fP
428.fi
429.RE
430.LP
431.TP 3
432\-Joption
tbell16c34dd2009-05-04 18:28:26 -0700433Pass \f2option\fP to the Java runtime environment, where \f2option\fP is one of the options described on the reference page for the java application launcher. For example, \f4\-J\-Xmx48M\fP sets the maximum memory to 48 megabytes. It is a common convention for \f2\-J\fP to pass options to the underlying runtime environment.
434.RE
435
duke6e45e102007-12-01 00:00:00 +0000436.LP
437.SH "COMMAND LINE ARGUMENT FILES"
438.LP
439
440.LP
441To shorten or simplify the jar command line, you can specify one or more files that themselves contain arguments to the \f2jar\fP command (except \f2\-J\fP options). This enables you to create jar commands of any length, overcoming command line limits imposed by the operating system.
442.LP
tbell16c34dd2009-05-04 18:28:26 -0700443An argument file can include options and filenames. The arguments within a file can be space\-separated or newline\-separated. Filenames within an argument file are relative to the current directory, not relative to the location of the argument file. Wildcards (*) that might otherwise be expanded by the operating system shell are not expanded. Use of the \f2@\fP character to recursively interpret files is not supported. The \f2\-J\fP options are not supported because they are passed to the launcher, which does not support argument files.
duke6e45e102007-12-01 00:00:00 +0000444.LP
445.LP
446When executing \f2jar\fP, pass in the path and name of each argument file with the \f2@\fP leading character. When \f2jar\fP encounters an argument beginning with the character \f2@\fP, it expands the contents of that file into the argument list.
447.br
448.br
449The example below, \f2classes.list\fP holds the names of files output by a \f2find\fP command:
450.LP
451.RS 3
452
453.LP
454.nf
455\f3
456.fl
457% find \fP\f3.\fP \-name '*.class' \-print > classes.list
458.fl
459.fi
460.RE
461
462.LP
463.LP
464You can then execute the \f2jar\fP command on \f2Classes.list\fP by passing it to \f2jar\fP using argfile syntax:
465.LP
466.RS 3
467
468.LP
469.nf
470\f3
471.fl
472% jar cf my.jar @classes.list
473.fl
474\fP
475.fi
476.RE
477
478.LP
479An argument file can specify a path, but any filenames inside the argument file that have relative paths are relative to the current working directory, not to the path passed in. Here is an example:
480.RS 3
481
482.LP
483.nf
484\f3
485.fl
486% jar @path1/classes.list
487.fl
488\fP
489.fi
490.RE
491
492.LP
493.LP
494
495.LP
496.SH "EXAMPLES"
497.LP
498
499.LP
500To add all the files in a particular directory to an archive (overwriting contents if the archive already exists). Enumerating verbosely (with the \f2\-v\fP option) will tell you more information about the files in the archive, such as their size and last modified date.
501.RS 3
502
503.LP
504.nf
505\f3
506.fl
507% ls
508.fl
5091.au Animator.class monkey.jpg
510.fl
5112.au Wave.class spacemusic.au
512.fl
5133.au at_work.gif
514.fl
515
516.fl
517% jar cvf bundle.jar *
518.fl
519added manifest
520.fl
521adding: 1.au(in = 2324) (out= 67)(deflated 97%)
522.fl
523adding: 2.au(in = 6970) (out= 90)(deflated 98%)
524.fl
525adding: 3.au(in = 11616) (out= 108)(deflated 99%)
526.fl
527adding: Animator.class(in = 2266) (out= 66)(deflated 97%)
528.fl
529adding: Wave.class(in = 3778) (out= 81)(deflated 97%)
530.fl
531adding: at_work.gif(in = 6621) (out= 89)(deflated 98%)
532.fl
533adding: monkey.jpg(in = 7667) (out= 91)(deflated 98%)
534.fl
535adding: spacemusic.au(in = 3079) (out= 73)(deflated 97%)
536.fl
537\fP
538.fi
539.RE
540
541.LP
542If you already have separate subdirectories for images, audio files and classes, you can combine them into a single jar file:
543.RS 3
544
545.LP
546.nf
547\f3
548.fl
549% ls \-F
550.fl
551audio/ classes/ images/
552.fl
553
554.fl
555% jar cvf bundle.jar audio classes images
556.fl
557added manifest
558.fl
559adding: audio/(in = 0) (out= 0)(stored 0%)
560.fl
561adding: audio/1.au(in = 2324) (out= 67)(deflated 97%)
562.fl
563adding: audio/2.au(in = 6970) (out= 90)(deflated 98%)
564.fl
565adding: audio/3.au(in = 11616) (out= 108)(deflated 99%)
566.fl
567adding: audio/spacemusic.au(in = 3079) (out= 73)(deflated 97%)
568.fl
569adding: classes/(in = 0) (out= 0)(stored 0%)
570.fl
571adding: classes/Animator.class(in = 2266) (out= 66)(deflated 97%)
572.fl
573adding: classes/Wave.class(in = 3778) (out= 81)(deflated 97%)
574.fl
575adding: images/(in = 0) (out= 0)(stored 0%)
576.fl
577adding: images/monkey.jpg(in = 7667) (out= 91)(deflated 98%)
578.fl
579adding: images/at_work.gif(in = 6621) (out= 89)(deflated 98%)
580.fl
581
582.fl
583% ls \-F
584.fl
585audio/ bundle.jar classes/ images/
586.fl
587\fP
588.fi
589.RE
590
591.LP
592To see the entry names in the jarfile, use the \f2t\fP option:
593.RS 3
594
595.LP
596.nf
597\f3
598.fl
599% jar tf bundle.jar
600.fl
601META\-INF/
602.fl
603META\-INF/MANIFEST.MF
604.fl
605audio/1.au
606.fl
607audio/2.au
608.fl
609audio/3.au
610.fl
611audio/spacemusic.au
612.fl
613classes/Animator.class
614.fl
615classes/Wave.class
616.fl
617images/monkey.jpg
618.fl
619images/at_work.gif
620.fl
621\fP
622.fi
623.RE
624
625.LP
626.LP
627To add an index file to the jar file for speeding up class loading, use the \f2i\fP option.
628.br
629.br
630Example:
631.br
632
633.LP
634.RS 3
635
636.LP
637If you split the inter\-dependent classes for a stock trade application into three jar files: \f2main.jar\fP, \f2buy.jar\fP, and \f2sell.jar\fP.
638.br
639
640.LP
641.br
642
643.LP
644If you specify the \f2Class\-path\fP attribute in the \f2main.jar\fP manifest as:
645.nf
646\f3
647.fl
648Class\-Path: buy.jar sell.jar
649.fl
650\fP
651.fi
652
653.LP
654then you can use the \f2\-i\fP option to speed up the class loading time for your application:
655.nf
656\f3
657.fl
658% jar i main.jar
659.fl
660\fP
661.fi
662
663.LP
664An \f2INDEX.LIST\fP file is inserted to the \f2META\-INF\fP directory. This enables the application class loader to download the specified jar files when it is searching for classes or resources.
665.RE
666.SH "SEE ALSO"
667.LP
668
669.LP
670.na
671\f2The Jar Overview\fP @
672.fi
tbell16c34dd2009-05-04 18:28:26 -0700673http://java.sun.com/javase/6/docs/technotes/guides/jar/jarGuide.html
duke6e45e102007-12-01 00:00:00 +0000674.br
675
676.LP
677.na
678\f2The Jar File Specification\fP @
679.fi
tbell16c34dd2009-05-04 18:28:26 -0700680http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html
duke6e45e102007-12-01 00:00:00 +0000681.br
682
683.LP
684.na
685\f2The JarIndex Spec\fP @
686.fi
tbell16c34dd2009-05-04 18:28:26 -0700687http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Index
duke6e45e102007-12-01 00:00:00 +0000688.br
689
690.LP
691.na
692\f2Jar Tutorial\fP @
693.fi
694http://java.sun.com/docs/books/tutorial/jar on the Java Software web site.
695.br
696
697.LP
tbell16c34dd2009-05-04 18:28:26 -0700698pack200(1)
duke6e45e102007-12-01 00:00:00 +0000699.LP
700