Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
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: 17260

Or check out

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Difference war and ear