LLMpediaThe first transparent, open encyclopedia generated by LLMs

jar (computing)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Expansion Funnel Raw 55 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted55
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
jar (computing)
NameJAR
DeveloperSun Microsystems; Oracle Corporation
Released1996
Latest release versionJava SE updates
Programming languageJava (programming language)
Operating systemCross-platform
GenreArchive file format

jar (computing) A JAR file is a packaged archive format designed to aggregate multiple Java (programming language) class files, metadata, and resources into a single distributable file. Originally developed by Sun Microsystems and maintained by Oracle Corporation as part of the Java Platform, Standard Edition, the format facilitates deployment, versioning, and execution of Java (programming language) applications across diverse environments such as Windows, Linux, and macOS. JAR files leverage the ZIP (file format) container and often interact with standards and technologies like the Java Virtual Machine, Manifest file, and Digital signature infrastructures.

Overview

A JAR file consolidates compiled Java (programming language) bytecode, images, configuration files, and libraries into a single archive that the Java Virtual Machine or other tools can read. It standardizes distribution for application developers working with platforms including Android (operating system), Apache Tomcat, and Jetty (web server), enabling simplified deployment to application servers, desktop environments, and cloud services such as Amazon Web Services or Google Cloud Platform. The JAR concept ties into package management, modularity, and classpath resolution practices established by projects like Apache Maven, Gradle, and Ivy (dependency manager).

Format and structure

Technically, a JAR file is a ZIP archive that contains a hierarchical directory structure with compiled classes and auxiliary resources. The root usually includes a META-INF directory containing a MANIFEST.MF manifest file that describes metadata such as the Main-Class entry used by the Java Virtual Machine to locate an application's entry point. MANIFEST.MF can include versioning information, classpath extensions, and digital signature references compatible with the Java Cryptography Architecture. JARs may embed nested JARs, service provider configuration files used by Java Platform, Standard Edition service loader mechanisms, and resource bundles for internationalization as used by projects like GNU gettext for localization.

Creation and tools

Developers produce JAR files using command-line utilities like the jar tool bundled with Java Development Kit distributions, or via build systems and IDEs such as Apache Ant, Apache Maven, Gradle, Eclipse (software), and IntelliJ IDEA. Continuous integration platforms like Jenkins, Travis CI, and GitHub Actions often automate JAR packaging within pipelines. Third-party packagers and repackagers such as One-JAR and Spring Boot provide executable JAR patterns that embed dependencies, while tools like proguard perform bytecode optimization and obfuscation during packaging. Library repositories like Maven Central and JCenter serve as distribution hubs for published JAR artifacts.

Usage and execution

Executable JARs can be launched by the Java Runtime Environment with the java -jar command, which relies on the MANIFEST.MF Main-Class attribute to invoke the application entry point. For library JARs, application classpaths specify dependency JARs either via command-line -cp options or manifest Class-Path attributes, and module-aware runtime behavior is governed by the Java Platform Module System introduced in Java SE 9. Application servers like GlassFish and WildFly and ecosystems such as Spring Framework frequently consume JARs as libraries or deployable artifacts, while mobile and embedded platforms like Android (operating system) convert Java artifacts into alternative packaging formats such as APK.

Security and signing

JAR signing enables integrity and authenticity checks by embedding digital signatures and certificates in the META-INF directory, typically generated with the jarsigner tool provided by the Java Development Kit. Signed JARs allow the Java Runtime Environment to verify the origin of code and to associate permissions when running in a security-managed environment like the deprecated Java Web Start or browser-based Java Applet contexts. Security concerns include certificate revocation, signature spoofing, and reliance on the Java Security Manager and policy files; modern recommendations emphasize code signing with reputable certificate authorities and minimizing privilege granted to untrusted archives.

Compression and performance

Because JAR extends ZIP compression, common algorithms like DEFLATE affect final file size and decompression speed. Tools and options such as store mode, compression level, and pre-compression impact startup latency, particularly for large monolithic “fat” or “uber” JARs produced by frameworks like Spring Boot or packaging utilities like One-JAR. Techniques to reduce overhead include modularizing code with Java Platform Module System, using native image compilation from projects like GraalVM to produce ahead-of-time artifacts, and serving content via HTTP/2 or CDN infrastructure such as Cloudflare or Akamai to reduce distribution time. Profilers and benchmarking tools like JMH help quantify performance trade-offs introduced by packaging strategies.

Compatibility and variants

Over time, variants and related formats emerged: executable WAR and EAR archives used by Java EE servers, shaded JARs that relocate packages via tools like the Maven Shade Plugin, and self-executable JARs wrapped with native launchers like those from Launch4j or jpackage introduced in recent OpenJDK toolchains. Backward compatibility is managed across Java SE releases, module system constraints, and classloader behavior in frameworks like OSGi and Apache Felix. Distribution ecosystems such as Maven Central and container platforms like Docker influence how JARs are versioned, scoped, and deployed in modern microservice architectures.

Category:Java (programming language)