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 b/w .jar, .ear, .war ? 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 b/w .jar, .ear, .war ?" Watch "Difference b/w .jar, .ear, .war ?" New topic

Difference b/w .jar, .ear, .war ?

SJ Rao

Joined: Mar 05, 2003
Posts: 25
Can someone please tell me the exact difference b/w .ear, .jar & .war ?
& under what circumstances should a application have these files ?

One of my application has a .ear file & an other application doesnt have. Both applications use framework which is based on MVC architecture.

So can someone tell me when do we deploy .ear file ?
Kripal Singh
Ranch Hand

Joined: Jul 26, 2001
Posts: 254
war jar and ear are j2ee components .
read more about them here

and here

# Help an unprivileged kid.<br /> Whatever u do will make a difference...<br /> a child's life & ur own #<br /><a href="" target="_blank" rel="nofollow"></a>
Masoud Kalali
Ranch Hand

Joined: Jul 08, 2004
Posts: 531


Jar files are Standard Java archive for storing Java classess or source file / any kind of resource for a formal application or library /frameworks

WAR files are Web archive which have a web.xml and some folders like web-inf inside it ,War file are standard for deploying in web application container like Tomcat , Resine ,Jetty...
you can include more folders , files into WAR files as you need
inside a WAR's web-inf you have Standard folders to store your JAR files.

and finally EAR files
which are Standard files extension for Java Enterprise Archive.
these files are deployable in J2ee containers like Jboss ,Oracle AS ,Websphere , Sun one....
an EAr file could containe several jar and WAR files.

All this file extension are compatible with Zip format.

Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
I agree. Here's the link:
subject: Difference b/w .jar, .ear, .war ?
It's not a secret anymore!