jQuery in Action, 3rd edition
The moose likes JSP and the fly likes Difference between a WAR and a JAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Difference between a WAR and a JAR file" Watch "Difference between a WAR and a JAR file" New topic

Difference between a WAR and a JAR file

Doshi Milan
Ranch Hand

Joined: May 29, 2001
Posts: 112
Dear Friends,
I would appreciate if I am told what is the difference between a WAR file and a JAR file. Specifically which one file is present in the WAR which is not present in the JAR.
Thanks and regards,
Milan Doshi
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

the extension is the only real difference on a 'file' level, as a WAR file can be made using the jar tool.

A jar file is simply a way to 'zip up' and compress a whole bunch of class files. They fit into the directories that reflect their packages, etc, etc...

A WAR file is used to compress a web application. It's directory structure is specified by the web application (servlet) spec.

So they are the exact same 'file type', but used for completely different purposes. There isn't really any one (or two or three) files that are 'missing' from one and present in another.
I agree. Here's the link: http://aspose.com/file-tools
subject: Difference between a WAR and a JAR file
It's not a secret anymore!