Jar Package
The JAR file format is based on the popular ZIP file format;
Unlike ZIP files, JAR files are used not only for compression and publishing, but also for deploying and encapsulating libraries, components, and plug-ins , and can be used by tools like compilers and JVMs Direct Use ;
The only difference between a jar file and a ZIP file is that it contains a meta-inf/manifest in the contents of the jar file . MF file, this file is created automatically when the JAR file is generated.
Role:
- As a toolkit and class library, this is the most basic role, in large projects, generally rely on n multi-jar package.
- As a building block for application engineering and expansion, when developing large applications, the application is typically divided into several units, each packaged in jar packages and interdependent.
- As a deployment unit for a component, applet, or plug-in program;
- Used to package the secondary resources associated with the component.
The internal structure of the typical jar package is as follows:
Tools.jar
| Resource.xml//Resource configuration file
| Other.xml
|
|-meta-inf
| MANIFEST. MF//Jar Package description file
|-com//Class of package directory
|-test
Util.class//Java class file
War pack
WAR (Web Archive file) network application files are platform-independent file formats that allow many files to be combined into a single compressed file. War is dedicated to the Web .
JAVA Web Engineering, are published as a war package.
The internal structure of a typical war package is as follows:
Webapp.war
| index.jsp
|
|-images
|-meta-inf
|-web-inf
| Web. XML//War package description file
|
|-classes
| Action.class//Java class file
|
|-lib
Other.jar//Dependent jar Package
Share.jar
Ear Package
The JAR file created for the Java EE application is an EAR file (Enterprise JAR file), a platform-independent file format that allows many files to be combined into a single compressed file.
For enterprise projects, the ear package is actually comprised of a war package and several enterprise-level project profiles , and the general server chooses WebSphere and so on.
The internal structure of the typical ear package is as follows:
App.ear
| Ejb.jar//Ejb-jar bag
| Other.jar//Common jar Package
| Webapp.war//War pack
|
|-meta-inf
Application.xml//Ear profile
JAR, WAR, EAR difference