JavaArchive (JAR) Features
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.JAR File Specification and Overview JAR Files and the Extensions FrameworkThis 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.
Enhanced Jar Tool
- 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.
Reading and Writing JAR Files: API Specification
- The Jar tool has the new -i option for creating JAR file indexes. See the Jar tool reference pages:
Jar tool reference page for Solaris
Jar tool reference page for Windows
java.util.jar: classes for creating and reading JAR files
- Class java.net.JarURLConnection: Abstract class for URL connections to JAR files using the jar protocol.
The API of classes java.util.zip and java.util.jar have been enhanced with the addition of the following: 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.TutorialOn the Java Software website:
- The Java Archive (JAR) File Format trail in the Java Tutorial.