top of page

Difference between JAR and WAR files in Java

Writer's picture: Vrunda ParikhVrunda Parikh

#

JAR

WAR

1.

​Stands for Java ARchive

Stands for Web application ARchive

2.

Contain libraries, resources and accessories files like property files.

Used to combine JSPs, servlets, Java class files, XML files, Javascript libraries, JAR libraries, static web pages, and any other resources needed to run the application.

3.

Contains .class file, manifest file and application resources like images, sound clips, and security certificates

Contains html, js, css, .class, jsp and servlets pages

4.

Used for working with any kind of application

Used for working on web applications

5.

To execute a JAR file, simple JDK is enough.

To execute a WAR file, a Web server or Web container is required, for example, Tomcat/ Weblogic/ Websphere/ Jetty/ GlassFish

Conclusion

The main difference between JAR and WAR Files is their content. The JAR files are the files that have Java class files, associated metadata and resources aggregated into a single file to execute a Java application. Whereas, the WAR files are the files that contain Servlet, JSP, HTML, JavaScript and other files necessary for developing web applications.
49 views0 comments

Recent Posts

See All

Battle of the Backends: Java vs Node.js

Comparing Java and Node.js involves contrasting two distinct platforms commonly used in backend development. Here’s a breakdown of their...

Commentaires


bottom of page