JAR, WAR, EAR difference

Source: Internet
Author: User

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:

    1. As a toolkit and class library, this is the most basic role, in large projects, generally rely on n multi-jar package.
    2. 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.
    3. As a deployment unit for a component, applet, or plug-in program;
    4. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.