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.