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 JAR,EAR,WAR files 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 "JAR,EAR,WAR files" Watch "JAR,EAR,WAR files" New topic


mah kumar

Joined: Feb 05, 2004
Posts: 22
hi all,
while deploying our application in a web server we come across files such as WAR,JAR,EAR...
i want to know the reason why we go for such files???and the details behind the WEB-INF directory structure???
thank you
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I think , WAR, EAR,JAR file is very important for test/development/installation . It's easy to use to deploy in all Web Server and Application SErver.

Java Developer, Thailand
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
Those are standard application archive files,
Since they are a standard any application server (at least in theory) will know how to unpack and deploy them so that clients can access your application. Makes it easy to deploy your application if it is any one of these files WAR or EAR
WAR is for web,
JAR is standard for packaging your classes and it's resources.
ear is for J2ee application archive which can have jar's as well as war's in them.
WEB-INF again is a standard where you place your application specific 3rd party jars in WEB-INF/lib nad WEB-INF/classes will have your application classes.
JAR, WAR, EAR or kind of zip files where everything you need is zipped up
Hope that helps


Even crazy and silly looking problems are sometimes real.
Natarajan Shankar
Ranch Hand

Joined: Jun 10, 2004
Posts: 53
You split class files and have things organized.

Normal Java Files and supporting File - JAR
JAR+WEB Componenets (JSP/HTML/SErvlet)- WAR

WEB-INF this directory will contain Web information. Will contain
web.xml file

Best Regards<br />N.Shankar<br />SCJP, SCWCD
I agree. Here's the link:
subject: JAR,EAR,WAR files
It's not a secret anymore!