Folder structure description of the Jar/ear/war package in Java

Source: Internet
Author: User

Jar Package: Code that is called a jar package, typically used as a tool class, is applied to the N multi-jar toolkit in the project.

War Package: JAVA Web project, are made into a war package, publish, if our server chooses Tomcat and other lightweight servers, generally the war package issued.

Ear Package: This is for enterprise-level projects, in fact, the ear package contains a war package and several enterprise-level project configuration files, the general server select WebSphere, etc., will use the ear package.

folder and Function Description:

1. Jar Package:

The JAR file format is based on the popular ZIP file format.

Unlike ZIP files, JAR files are not only used for compression and publishing, but are also used to deploy and encapsulate libraries, components, and plug-ins, and can be used directly by tools such as compilers and JVMs.

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, 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 package directory          |-test                     util. Class       
2. 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           |                      description file for Web. XML/ War Package           |           | -classes           |          Action. Class       // java file, compiled byte code          |           | -lib                     Other. Jar           // dependent jar package                     share
3. Ear Package:

The JAR (Java Archive,java archive) is a platform-independent file format that allows many files to be combined into a single compressed file.

The JAR file created for the Java EE application is an EAR file (Enterprise JAR 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 Package    |   other. Jar              / common jar Package    |   WebApp. War         / War Package    |    | -meta-inf           Application

The Web Standard package is the war mode, the Java EE Standard package uses the ear method, the difference is that you must support the Java EE environment in order to use the ear mode, for example, in Tomcat can not use the ear, but in the weblogic of both, The ear mode contains a much wider range than the war, like a small circle inside a great circle, which is contained and contained.

Original: http://hck.iteye.com/blog/1751951

Folder structure description of the Jar/ear/war package in Java (GO)

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.