wood burning stoves
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 17276

Or check out http://www.coderanch.com/t/319377/EJB-JEE/java/differences-between-WAR-file-EAR

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: http://aspose.com/file-tools
subject: Difference war and ear
It's not a secret anymore!