What is JAR? The Java Archive File Format Explained
A ZIP-based package that bundles Java classes, resources, and metadata into one file.
Last updated:
What is JAR?
JAR, short for Java Archive, is a package file format used to aggregate many Java class files, associated metadata, and resources such as images and configuration data into a single file. It was developed by Sun Microsystems and is built on the ZIP file format.
A JAR is a ZIP archive that, by convention, contains a special META-INF directory holding a MANIFEST.MF file. The manifest records attributes such as the main class for executable JARs, classpath entries, and optional code-signing information, allowing the archive to function as a self-contained, runnable unit.
How JAR Works
A JAR is physically a ZIP archive, so it uses the same per-entry DEFLATE compression and central directory.[2] The defining addition is the META-INF directory, whose MANIFEST.MF file holds attribute lines such as Main-Class and Class-Path; the Java launcher reads these to run an executable JAR or resolve dependent archives.[1]
Signing and Security
JARs can be cryptographically signed by storing per-file digests in the manifest plus signature files in META-INF, letting the runtime verify that contents were not altered after signing.[1] This mechanism underpinned the security model of applets and other downloadable Java code.[2]
Standardization and Variants
The format is registered with IANA under the media type application/java-archive.[3] Specialized derivatives reuse the same ZIP structure for specific deployment targets, including WAR files for web applications and EAR files for enterprise applications.[2]
MKV Technical Specifications
JAR vs Other Archive Formats
| Feature | JAR | ZIP |
|---|---|---|
| Underlying format | ZIP-based[2] | ZIP |
| Compression | DEFLATE | DEFLATE |
| Manifest / metadata | META-INF manifest[1] | None required |
| Code signing | Supported[1] | Not native |
| Best for | Java applications[3] | General sharing |
A JAR is essentially a ZIP archive with added Java-specific manifest and signing conventions.
Advantages & Disadvantages
Advantages
Bundles all classes and resources into one file, simplifying deployment and distribution.
Uses the well-understood ZIP format, so contents are compressed and broadly tool-compatible.
A manifest can mark a main class for direct execution, and JARs can be digitally signed for integrity.
The same JAR runs on any platform with a compatible Java Virtual Machine.
Disadvantages
JAR files cannot run without a Java runtime installed on the target system.
A plain JAR does not bundle external library dependencies unless built as a 'fat' or 'uber' JAR.
Java bytecode inside a JAR can be decompiled, so source logic is not well protected by default.
Common Use Cases
JAR is the standard packaging unit across the Java ecosystem.
Application distribution | FileFormer
Complete Java applications are shipped as executable JARs that run via the java command.
Libraries and dependencies | FileFormer
Reusable Java libraries are published as JARs and pulled in by build tools such as Maven and Gradle.
Web and enterprise components | FileFormer
JARs are the building blocks bundled inside WAR and EAR archives for server-side applications.
Convert JAR Files Free
Use our free online archive converter to convert JAR and other formats - no signup, no watermarks.
Try Archive Converter FreeFrequently Asked Questions
What is inside a JAR file?
Compiled Java class files, resources such as images and properties, and a META-INF directory containing a MANIFEST.MF file.
Is a JAR file just a ZIP file?
Yes. A JAR uses the ZIP format and can be opened with ZIP tools, with the addition of a Java-specific manifest.
How do I run a JAR file?
If it is an executable JAR with a Main-Class in its manifest, run it with 'java -jar app.jar'.
What is the MANIFEST.MF file?
It is a metadata file in META-INF that defines attributes such as the main class, classpath, and signing details.
What is a fat or uber JAR?
It is a JAR that bundles the application together with all of its dependencies so it can run standalone.