What is the difference between an Ear, Jar, and war file?

Source: Internet
Author: User
What is the difference between an Ear, Jar, and war file? What kind of environment they are used separately.

In the file structure, the three are not different, they are in the zip or jar file compression format. But they are used for different purposes:

  jar file (with the extension. Jar) contains common libraries, resources, and auxiliary files (auxiliary files) for Java classes

  War file (with the name extension. War) contains all Web applications. In this case, a Web application is defined as a separate set of files, classes, and resources, and the user can encapsulate the jar file and access it as a small service program (servlet).

  Ear File (with the extension. Ear) contains all enterprise applications. In this case, an enterprise application is defined as a collection of multiple jar files, resources, classes, and Web applications.

Each file (. jar,. War,. Ear) can only be handled by the application server (application servers), the Small Service program container (servlet containers), the EJB container (EJB containers), and so on.

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.