top of page

Difference between JAR and WAR files in Java


#

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.

Recent Posts

See All

Commenti


bottom of page