JAR (Java archive)
Also known as: jar file, java archive, executable jar
A JAR (Java Archive) packages compiled Java classes and resources into a single file for distribution. It is a ZIP archive with an added manifest, letting a whole Java library or application travel and run as one bundle.
- ZIP-based archive of compiled Java classes
- Includes a manifest that can name a main class
- Ships libraries or runnable Java applications
What a JAR contains
JAR stands for Java Archive. It is a ZIP file that bundles a program’s compiled `.class` files together with images, configuration, and other resources. A special META-INF/MANIFEST.MF entry describes the archive and can name a main class so the JAR runs on its own.
Because it is just ZIP, a JAR can be opened with any archive tool. Renaming it to .zip reveals the package structure inside.
How JARs are used
Developers ship libraries as JARs so other projects can depend on them, and an executable JAR can be launched directly when a Java runtime is installed. They are common on desktops and servers rather than phones, where Android compiles code into its own DEX format instead.