What is JAR? The Java Archive File Format Explained

JAR (Java Archive) is a ZIP-based file format from Sun Microsystems for packaging Java classes, resources, and a manifest into a single distributable unit.

Free online file converter tool. Works in Chrome Firefox Safari Edge Opera and other modern browsers on Windows macOS Linux Android and iOS. No software installation or sign-up required. All conversions run directly in your browser, so your files never leave your device. Free to use with no account needed.

Archive

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:

Year Created1996
CompressionArchive (application package)
Primary UseJava application packaging

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

DeveloperSun Microsystems (now Oracle)[1]
File Extension.jar[1]
MIME Typeapplication/java-archive[1]
Released1996 (JDK 1.1 era)[1]
TypeZIP-based application archive[1]

JAR vs Other Archive Formats

FeatureJARZIP
Underlying formatZIP-based[2]ZIP
CompressionDEFLATEDEFLATE
Manifest / metadataMETA-INF manifest[1]None required
Code signingSupported[1]Not native
Best forJava applications[3]General sharing

A JAR is essentially a ZIP archive with added Java-specific manifest and signing conventions.

Advantages & Disadvantages

Advantages

Single distributable unit | FileFormer

Bundles all classes and resources into one file, simplifying deployment and distribution.

Built on ZIP | FileFormer

Uses the well-understood ZIP format, so contents are compressed and broadly tool-compatible.

Executable and signable | FileFormer

A manifest can mark a main class for direct execution, and JARs can be digitally signed for integrity.

Cross-platform | FileFormer

The same JAR runs on any platform with a compatible Java Virtual Machine.

Disadvantages

Requires a JVM | FileFormer

JAR files cannot run without a Java runtime installed on the target system.

Dependency handling | FileFormer

A plain JAR does not bundle external library dependencies unless built as a 'fat' or 'uber' JAR.

Decompilation risk | FileFormer

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 Free

Frequently 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.

References

  1. JAR File Overview - Oracle Java Documentation
  2. JAR (file format) - Wikipedia
  3. application/java-archive - IANA