.ear, .war, and .jar files are simply files zipped using Java jar tool. Each file is created for a different purpose:
Jar (Java Archive) files contain libraries, resources and accessory files such as property files.
Ear (Enterprise Archive) files contain EJB modules.
To open an archive file created with JAR such as .jar, .war, ear files, use the following command:
$ jar -xf file.jar $ jar -xf file.war