HiveBrain v1.2.0
Get Started
← Back to all entries
gotchajavaCritical

Difference between jar and war in Java

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
warjavaandbetweendifferencejar

Problem

What is the difference between a .jar and a .war file?

Is it only the file extension or is there something more?

Solution

From Java Tips: Difference between ear jar and war files:

These files are simply zipped files
using the java jar tool. These files are
created for different purposes. Here
is the description of these files:

-
.jar files: The .jar files contain
libraries, resources and
accessories files like property files.

-
.war files: The war file contains
the web application that can be
deployed on any servlet/jsp
container. The .war file contains jsp,
html, javascript and other files
necessary for the development of web
applications.

Official Sun/Oracle descriptions:

  • The J2EETM Tutorial: Web Application Archives



  • The Java Archive (JAR) File Format: The Basics



Wikipedia articles:

  • WAR file format (Sun)



  • JAR file

Context

Stack Overflow Q#5871053, score: 484

Revisions (0)

No revisions yet.