Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes j2ee 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 "j2ee" Watch "j2ee" New topic
Author

j2ee

raja_kamal3
Greenhorn

Joined: Oct 07, 2002
Posts: 1
what is the main use of .ear and .war and .jar file?
how it is interrelated, without .ear file,can i run a servlet program in j2ee?


dsfs
Mahesh Kulkarni
Ranch Hand

Joined: Jul 05, 2001
Posts: 62
Hi raj,
The main use of different files is as follows.
1) .jar(Java archive) file
This is used to create jar for ejb classes(Remote,Home,Implementation) and META-INF. Also jar can be used when you want ship your own classes in .jar format (Eg being j2ee.jar or struts.jar)
2) .war(web archive) file
This is used to create the web archive.This will have all the classes,web.xml other web required files.
3) .ear (Enterprise Archive) file
This is used to combine .war and .jar files for enterprise deployment.
4) .rar (Resource Archive) file
This is used to archive the Resource adapter files (for JCA only).
The major use of this formats is that it helps us to ship the application on different servers.
yes servlet can be run through .war application and also through .ear files
Thx
Mahesh
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
"raja_kamal3",
Thanks for joining JavaRanch, but could you just take a quick look at the naming policy and edit your profile accordingly.
Thanks!
Simon
Bartender (moderator) of "J2EE and EJB" forum
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: j2ee