pack200.exe : Java Glossary

I-ching hexgram 64, almost here  pack200.exe
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.
~ I Ching
pack200.exe is Sun’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.

The Catches

  1. 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.
  2. 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.
  3. Signed jars that have been packed with pack200.exe cannot be verified until they have been unpacked with unpack.exe.
  4. 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 have to be unzipped at the other end, and there it will sit on disk in completely uncompressed form.
  5. 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.
  6. Pack modifies the class files. It strips out anything that is not strictly necessary.
Oracle’s JDK Tool Guide to pack200.exe : available:
Oracle’s Javadoc on Pack200 class : available:
Oracle’s Technote Guide on server and pack200 : available:


CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/pack200exe.html J:\mindprod\jgloss\pack200exe.html
logo
Please email your , letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email. If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.213]
You are visitor number 15,619.