• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference between .jar and .war files

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i know that jar file is a zipped file which contains .class files
and war file is a zipped fiel that contains class files of servlets it may also inclde html and jsp


but wht is the clear difference between war and jar file
and wht is command to make the jar and war file
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sandiri,
Welcome to JavaRanch!

You got the difference between a JAR and a WAR. WARs are web applications containing HTML, JSPs, servlets and a deployment descriptor. All of these files must be arranged in a specified directory format.

This article from Sun provides more details on the directory structure. It also provides the syntax of the jar command for creating jars/wars. Note that it is the same command as the compression technique is the same. for both.
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you pretty much have it. Except most servlet engines like tomcat will recognize war files and unpack them.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the difference is exactly one letter...
And of course a war file is expected to have a certain directory layout which corresponds with the directory layout of a valid web application, but that's no different from a standard jar file being expected to have a directory layout corresponding to a package tree
 
reply
    Bookmark Topic Watch Topic
  • New Topic