pack200

Pack200, specified in JSR 200{{cite web |url=https://www.jcp.org/en/jsr/detail?id=200 |title=JSR 200: Network Transfer Format for Java Archives. |access-date=2014-06-09}} (J2SE 1.5), deprecated in JEP 336{{cite web |url=https://openjdk.java.net/jeps/336 |title=JEP 336: Deprecate the Pack200 Tools and API |access-date=2018-11-10}} (Java SE 11) and removed in JEP 367 (Java SE 14),{{cite web |url=https://openjdk.java.net/jeps/367 |title=JEP 367: Remove the Pack200 Tools and API |access-date=2020-06-02}} is a compacting archive format developed by Sun, capable of reducing JAR file sizes by up to a factor of 9,{{Cite web |title=Pack200: A Packed Class Deployment Format For Java Applications |url=https://docs.oracle.com/en/java/javase/11/docs/specs/pack-spec.html |access-date=2022-05-14 |website=docs.oracle.com}} with a factor of 3 to 4 seen in practice.{{Cite web |title=Smaller Java |url=https://dzone.com/articles/smaller-java |access-date=2022-05-14 |website=dzone.com |language=en}}{{Cite web |title=Combining Ant, Jar, Signatures and Pack200 |url=https://bfo.com/blog/2010/05/13/combining_ant_jar_signatures_and_pack200/ |access-date=2022-05-14 |website=bfo.com}} Pack200 is optimized for compressing JAR archive files, specifically the Java bytecode portion of the JAR files. Applications of this technology include faster Java application deployment over Java Web Start.

After Pack200, gzip compression is usually applied. In HTTP compression, such content is specified by the Content-Encoding type pack200-gzip. When stored as a file, the extension .pack.gz is used.{{Cite web |title=Pack200 and Compression for Network Deployment |url=https://web.mit.edu/java_v1.5.0_22/distrib/share/docs/guide/deployment/deployment-guide/pack200.html |access-date=2022-05-14 |website=web.mit.edu}}

Pack200 may also refer to the Pack200 compression tools (pack200 and unpack200) provided in the Java Development Kit from Java 5 until Java 14.

Design

{{Expand section|date=May 2022}}

Pack200 modifies the contents of the Java class files in the JAR archive undergoing compression. Transformations to the class files include merging constant pools and removing duplicated attributes.{{Cite web |title=Pack200 Compression Method |url=https://www.advancedinstaller.com/user-guide/pack200.html |access-date=2022-05-14 |website=www.advancedinstaller.com |language=en}} The format is not lossless; it is possible for a JAR file after unpacking to not be identical to how it was before packing.{{Cite web |title=Commons Compress – Commons Compress Pack200 Package |url=https://commons.apache.org/proper/commons-compress/pack200.html |access-date=2022-05-14 |website=commons.apache.org}}

References