aspose file tools*
The moose likes Servlets and the fly likes Difference between JAR,WAR and EAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Difference between JAR,WAR and EAR" Watch "Difference between JAR,WAR and EAR" New topic
Author

Difference between JAR,WAR and EAR

rajesh yedula
Greenhorn

Joined: Dec 22, 2011
Posts: 11
Hi all,,

Can anybody help me out when Jar,War and Ear files are used.I don't have any knowledge about these things.I don't know how to use in web applications.

Please help me out with clear cut explanation.

In which situation we need to go for which file.Who introduced these types of files and how to deploy them.

Thanks............
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 166

1. Java Archives (JAR) A JAR file encapsulates one or more Java classes, a manifest, and a descriptor. JAR files are the lowest level of archive. JAR files are used in J2EE for packaging EJBs and client-side Java Applications.

2. Web Archives (WAR) WAR files are similar to JAR files, except that they are specifically for web applications made from Servlets, JSPs, and supporting classes.

3. Enterprise Archives (EAR) ”An EAR file contains all of the components that make up a particular J2EE application.


No pain, No gain.
OCJP 1.6
rajesh yedula
Greenhorn

Joined: Dec 22, 2011
Posts: 11
Hi Subramani,


Great thanks for your detailed explanation of topic.

I have one more question,it seems to be simple & silly but i have some confusions over that.

What is difference between Web Application & Enterprise Application? what these applications comprises and based on which factors we will decide which is Web or Enterprise Application?.

Thanks.........
Nico Van Brandt
Ranch Hand

Joined: Mar 31, 2011
Posts: 66

You create an Enterprise Application when your application consists of multiple items. For example: 1 Web Application and two EJB Modules.
By doing this you only have to deploy 1 file on an application server (the .ear file)


Oracle Java SE6 Certified Programmer
Oracle Java EE5 Certified Web Component Developer
rajesh yedula
Greenhorn

Joined: Dec 22, 2011
Posts: 11
Hi Nico,

nice and straight description,i got the point what you said.

As per my knowledge is concerned, JAR files are introduced by Java People. Likewise who introduced War and Ear files.

I know that we can create & deploy jar files in 2 ways. 1)Through Command Prompt 2)Through IDE.

Same way how to create & deploy these Ear & War files?
Nico Van Brandt
Ranch Hand

Joined: Mar 31, 2011
Posts: 66

Yes, WAR files can be created using the standard Java jar command
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between JAR,WAR and EAR