JAR (Java Archive) is a platform-independent file format that aggregates many
files into one. Multiple Java applets and their requisite components
(.class files, images and sounds) can be bundled in a JAR file and
subsequently downloaded to a browser in a single HTTP transaction,
greatly improving the download speed. The JAR format also supports
compression, which reduces the file size, further improving the download
time. In addition, the applet author can digitally sign individual entries
in a JAR file to authenticate their origin. It is fully backward-compatible
with existing applet code and is fully extensible.
This version of the Java platform extends
the utility of the JAR
format. Enhancements include added functionality for the
command-line JAR tool for creating Jar-file indexes for faster
access to Jar-file contents.
There are also new standard APIs for a "delete-on-close" mode for
opening Jar files.
The new extensions mechanism in the Java platform uses the
JAR file format to package extension classes. Manifest attributes
are available to support the extension mechanism and related
features such as package sealing and package versioning. See the
extensions specification
for details.
Enhanced Jar Tool
The Jar tool has the new -i option for
creating JAR file indexes. See the Jar tool reference pages:
The previous implementation of caching downloaded Jar files
created problems for long-running server application and for RMI.
Each open JarURLConnection creates a temporary local file that
holds Jar-file date, and a JarFile object is created on top of the
temporary file. Because the open file handle/descriptor on
each temporary file was never closed, the files could quickly
take up disk space for long-running server applications. The
new API provides a solution for this problem by supporting
a new "delete-on-close" mode for opening Zip and Jar files.