IntelliJ Java IDE
The moose likes EJB and Other Java EE Technologies and the fly likes diff between jar, ear and war files in detail Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "diff between jar, ear and war files in detail" Watch "diff between jar, ear and war files in detail" New topic
Author

diff between jar, ear and war files in detail

nallagangu
Greenhorn

Joined: Oct 25, 2001
Posts: 3
Hello All,
Can some one explain the diff between application level(ear) web archive(war) and java archive(jar) files in detail..
thanks in Advance...
Nallagangu
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
It's really not all that complicated. JAR EAR and WAR file are first and foremost, all ZIP files. They thus contain other files. There's a nesting structure here:

EAR (Application Archive)
EAR Contains 0..N WAR (Web Archives)
WAR Contains 0..N Servlet (.class) files
WAR Contains 0..N JSP files
WAR Contains 0..N other utility files (.jars and .class files)
EAR Contains 0..N EJB JAR files
EJB JAR Contains 1..N EJB's (each EJB has at least 3 .class files)
Every file type (EAR, JAR and WAR) has a special "deployment descriptor" that is an XML file describing its contents to the application server. for the EAR this is the application.xml file. For the WAR it's web.xml. For the EJB JAR it's EJB-JAR.XML.
For more information (and a set of cool diagrams) see Richard Monson-Haefel's 3rd Edition EJB book, and my WebSphere workbook (http://www.oreilly.com/catalog/entjbeans3/workbooks/index.html) for this book. (You can download the workbook).
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
[This message has been edited by Kyle Brown (edited October 25, 2001).]
[This message has been edited by Kyle Brown (edited October 25, 2001).]


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
deep venu
Ranch Hand

Joined: Jun 09, 2001
Posts: 56
Hi,
A JAR file can be a group of java classes. In J2EE context it would have all the classes of beans, DAO, Data objects, static classes etc.
Your WAR (Web Archive) would contain all thw web components like htmls, images, jsps, servlets,CSS files etc..
An EAR ( Enterpise Archive ) file usually contains JAR and WAR files and in gets deployed as an application in your app server.
:-)
Dee
 
 
subject: diff between jar, ear and war files in detail
 
Threads others viewed
diff between jar, ear and war files in detail
JAR, WAR and EAR
What are ear,war and jar files ?
War with WAR, EAR and JAR
jar,ear and war
IntelliJ Java IDE