Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between JAR,WAR and EAR

 
rajesh yedula
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
rajesh yedula
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
rajesh yedula
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, WAR files can be created using the standard Java jar command
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic