Java - Packaging, Archive, Library (JAR, WAR, EAR File)

Java Conceptuel Diagram

About

For deployment purpose, J2EE applications are delivered and reside in Archive files (or unit).

A RAR, WAR or EAR file is a standard JAR (.jar) file with a .war or .ear extension. Each archive extension file denotes its purpose. A JAR (Java ARchive) file format is based on the standard ZIP file format with an optional manifest file.

J2EE Archive Type File Extension Module Type
Enterprise Archive EAR All modules together
Java Archive JAR Enterprise Bean Module, Application Client module
Web Archive WAR Web module
Resource Adapter RAR Ressource Adapter module

A J2EE archive is composed of:

Using modules and JAR, WAR, EAR files makes it possible to assemble a number of different J2EE applications using some of the same components. No extra coding is needed; it is just a matter of assembling various J2EE modules into Java EE JAR, WAR, or EAR files.

Management

unpack an archive

The following command will unpack the archive in the current directory

jar xvf myArchive.ear

The following command will unpack all ear archive in the current directory

jar xvf *.ear

load dynamically a JAR

See The System class contains a means of loading files and libraries with the methods (load and loadlibrary). For a class, see Java - Class (Definition)

search a jar

scan

Structure and Content

EAR

An EAR file contains:

J2ee Ear Structure

where:

  • the directory META-INF contains the configuration files (deployment descriptors, manifest). META-INF is WEB-INF for a Web module.

The MANIFEST.MF files are created automatically by the JAR utility

Module

A Java EE module consists of:

  • one or more Java EE components for the same container type (Ejb, Web component, …)
  • and, optionally, one component deployment descriptor of that type.

A Java EE module can be deployed as a stand-alone module.

Java EE modules are of the following types:

EJB

An EJB modules contain:

EJB modules are packaged as JAR files with a .jar extension.

Web

Java - Web Application (Web Module) - War

Application client

Application client modules contain:

  • class files
  • and an application client deployment descriptor.

Application client modules are packaged as JAR files with a .jar extension.

Resource adapter

Resource adapter modules contain:

  • all Java interfaces,
  • classes,
  • native libraries,
  • and other documentation,
  • along with the resource adapter deployment descriptor.

Together, these implement the Connector architecture for a particular EIS.

Resource adapter modules are packaged as JAR files with an .rar (resource adapter archive) extension.

Documentation / Reference





Discover More
Card Puncher Data Processing
Ant

is a build tool such as make, gnumake, nmake, jam,... without their limitations. is a Java technology-based build tool developed by the Apache Software Foundation (). supplies...
Eclipse Add External Lib Classe12
Eclipse - How to add an archive to the classpath ?

How to add in the Classpath an archive. In this example a Jdbc Driver (JAR File). download the archive. For an Oracle Jdbc driver, you can found them on...
Java Conceptuel Diagram
How to distribute your (Desktop) Java application to your users ?

An article that 1001 ways to bring your application to your users. This page talks especially over Desktop and Command application because Web Application Packaing is dependent of your web framework ?...
Card Puncher Data Processing
Hudson - Installation version 3.0.0-RC3 (Standalone and Weblogic)

Installation of Hudson in: as a standalone application or in a Weblogic java container Download the Hudson.war Hudson can run in a standalone...
Java Conceptuel Diagram
J2EE - (Web) Resources

(Web) Resources are any software artifacts that the web application requires for proper rendering, including: images, script files, and any user-created component libraries. A Resource may be...
Java Conceptuel Diagram
J2EE - Tools

The J2EE reference implementation provides: an application deployment tool and an array of scripts for assembling, verifying, and deploying J2EE applications and managing your development and production...
Java Conceptuel Diagram
Java - (Jar|Java ARchive) File

JAR stands for Java ARchive and is file format born in 1996 as a simple extension of the popular ZIP archive format with class and other required resource files: manifest signature files images,...
Java Conceptuel Diagram
Java - Application

An application in shipped in an archive format with a main class that contains a main method that starts the application. instancejava/lang/Runtimeclass RuntimeOperating System environment ...
Java Conceptuel Diagram
Java - Deploy (Deployment)

In j2ee terminology the installation process is called deployment. Once a Java EE unit has been produced, it is ready to be deployed. Deployment typically involves using a platform’s deployment tool...
Java Conceptuel Diagram
Java - Deployment descriptors (Metadata)

Deployment descriptors are XML documents included in the JARs that describes: component's configuration, deployment settings of an application, a module, or a component of and instructions to the...



Share this page:
Follow us:
Task Runner