Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Pack200"

 
Line 1: Line 1:
== Pack200 ==
 
 
 
'''Overview'''<br>
 
'''Overview'''<br>
 
<p>Pack200 is a compression technology included in Java 1.5.0.  It was designed for compressing jars and works most efficiently on Java class files.  Using Pack200 compression can reduce the size of a jar by about 60%.</p>
 
<p>Pack200 is a compression technology included in Java 1.5.0.  It was designed for compressing jars and works most efficiently on Java class files.  Using Pack200 compression can reduce the size of a jar by about 60%.</p>
Line 9: Line 7:
  
 
== Jar Processor ==
 
== Jar Processor ==
 +
<p>The Jar Processor is a tool provided by the org.eclipse.update.core bundle that will recursively run the pack200, signing and unpack200 tools on a jar and its nested jars.  The jar processor can be exported into a self contained jar using the <code>org.eclipse.update.internal.jarprocessor/jarprocessor.jardesc</code> jar description file.  The jar processor can also be accessed through the <code>org.eclipse.update.core.siteOptimizer</code> application.</p>
  
 +
The jarprocessor understands the following command-line options:
 +
{| border="1" cellpadding="2"
 +
!width="150"|Option
 +
!width="500"|Effect
 +
|-
 +
|&ndash;repack
 +
|Normalize the jar by calling the pack200 tool with the -repack option.
 +
|-
 +
|&ndash;pack
 +
|Pack the jar using the pack200 tool
 +
|-
 +
|&ndash;sign <command>
 +
|Sign the jar using the provided command.  The sign command will be provided the name of the jar to sign as its first argument.
 +
|-
 +
|&ndash;unpack
 +
|Unpack a pack.gz file into a jar using the unpack200 tool.
 +
|-
 +
|&ndash;outputDir <directory>
 +
|The directory in which to place the results.
 +
|}
 +
The repack, sign and pack options can be specified together.  When specifying all 3, the input jar will first be normalized, then signed, then packed.  The output will be the signed jar and a packed jar.pack.gz file.
 +
== Update Sites ==
 
== External Links ==
 
== External Links ==
 
[http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html Pack200 and Compression]<br>
 
[http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html Pack200 and Compression]<br>

Revision as of 16:40, 20 April 2006

Overview

Pack200 is a compression technology included in Java 1.5.0. It was designed for compressing jars and works most efficiently on Java class files. Using Pack200 compression can reduce the size of a jar by about 60%.

Pack200 is not a lossless compression. Packing and unpacking will produce a jar that is semantically the same as the original, but classfile structures will be rearranged; the resulting jar will not be identical to the original. However, this reordering is idempotent so a second pack-unpack will not further change the jar.

Signing

Signing a jar hashes the contents and stores the hash codes in the manifest. Since packing and unpacking a jar will modify the contents, the jar must be normalized prior to signing. Normalizing the jar will also be refered to as repacking the jar.

Jar Processor

The Jar Processor is a tool provided by the org.eclipse.update.core bundle that will recursively run the pack200, signing and unpack200 tools on a jar and its nested jars. The jar processor can be exported into a self contained jar using the org.eclipse.update.internal.jarprocessor/jarprocessor.jardesc jar description file. The jar processor can also be accessed through the org.eclipse.update.core.siteOptimizer application.

The jarprocessor understands the following command-line options:

Option Effect
–repack Normalize the jar by calling the pack200 tool with the -repack option.
–pack Pack the jar using the pack200 tool
–sign <command> Sign the jar using the provided command. The sign command will be provided the name of the jar to sign as its first argument.
–unpack Unpack a pack.gz file into a jar using the unpack200 tool.
–outputDir <directory> The directory in which to place the results.

The repack, sign and pack options can be specified together. When specifying all 3, the input jar will first be normalized, then signed, then packed. The output will be the signed jar and a packed jar.pack.gz file.

Update Sites

External Links

Pack200 and Compression
JAR Packing tool
JAR Unpacking tool
JAR Signing and Verification tool

Back to the top