File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Difference war and ear Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Difference war and ear" Watch "Difference war and ear" New topic

Difference war and ear

Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178

what is the difference between a war file and an ear file? They are both normal zip files format-wise (right?), but what are the differences regarding their purpose?
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

No difference in their compression format, just their purpose. An EAR is an enterprise application that may include a number of web applications, ejb applications etc. A WAR is specifically a web application. There are rules about how the contents of each should be structured in the JEE specification.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178
So a war file can be a subset of a ear file but still be able to stand alone (if the application provides for it)?
Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178
I just realized that my question was worded badly: is there any diagram (I'm a visual guy, I'm afraid) that shows an EAR's structure with possible content?
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Or check out

The thread that is only three threads below this one right now.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Difference war and ear
It's not a secret anymore!