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.
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
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)
An EAR file contains:
where:
The MANIFEST.MF files are created automatically by the JAR utility
A Java EE module consists of:
A Java EE module can be deployed as a stand-alone module.
Java EE modules are of the following types:
An EJB modules contain:
EJB modules are packaged as JAR files with a .jar extension.
Java - Web Application (Web Module) - War
Application client modules contain:
Application client modules are packaged as JAR files with a .jar extension.
Resource adapter modules contain:
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.