pack200.exe : Java Glossary
A little fox crosses a stream in China. If he goes a little too boldly and
confidently — unlike a wiser older fox — he is likely to get wet. At
the very end of his crossing, his over-confidence reaches its peak, he feels his
feet on dry ground, he relaxes his vigilance and his tail drops into the water.pack200.exe is Oracle’s compression utility
in Java version 1.5 or later
for supercompressing large (> 2 MB) jars of class files. The resulting file has a
*.jar.pack.gz extension and a application/x-java-pack200 MIME (Multipurpose Internet Mail Extensions)
type and pack200-gzip content encoding type.
~ I Ching
- You must modify your HTTP (Hypertext Transfer Protocol) server to
deliver jars in three flavours, *.jar, *.jar.gz and *.jar.pack.gz based on generic
*.jar requests. You must prepare and upload all three
flavours of jar.
- Pack200.exe and Unpack200.exe
are native utilities, not java classes. You must do all your handling of such
jars via external exec of these
JRE (Java Runtime Environment) command line utilities.
- Signed jars that have been packed with pack200.exe
cannot be verified until they have been unpacked with unpack.exe.
- Pack200.exe is specialised for class files. If your
jar is mainly resources, you are better off to create a jar of stored
(uncompressed) entries, then compress the whole thing with GZIP. This works
considerably better than GZIPping a file of already compressed entries. Then you
will have a *.jar.gz extension and gzip content encoding. It will have to be unzipped at the other end,
and there it will sit on disk in completely uncompressed form.
- Packed files don’t have a simple unique extension, thus they can’t
be easily handled by the extension to MIME
tables in an HTTP
server. They require custom coding.
- Pack modifies the class files. It strips out anything that is not strictly
Oracle’s JDK Tool Guide to pack200.exe
Oracle’s Technote Guide on pack200
Oracle’s Javadoc on Pack200
class : available: