JAR, WAR and EAR Files in Java Applications:

Abhishek Singh
1 min readFeb 20, 2021

JAR stands for Java ARchive

WAR stands for Web application ARchive

EAR stands for Enterprise Application aRchive

A JAR file extension is .jar and is created with jar command
from command prompt (like javac command is executed). Generally,
a JAR file contains Java related resources like libraries, classes
etc.JAR file is like winzip file except that Jar files are platform
independent.

A WAR file is simply a JAR file but contains only Web related Java
files like Servlets, JSP, HTML, To execute a WAR file, a Web server
or Web container is required, for example, Tomcat or Weblogic or
Websphere, To execute a JAR file, simple JDK is enough.

In J2EE application, modules are packaged as EAR, JAR,
and WAR based on their functionality

JAR: EJB modules which contain enterprise java beans (class files)
and EJB deployment descriptor are packed as JAR files with .jar
extension

WAR: Web modules which contain Servlet class files, JSP Files,
supporting files, GIF and HTML files are packaged as a JAR file
with .war (web archive) extension

EAR: All the above files (.jar and .war) are packaged as a JAR
file with .ear (enterprise archive) extension and deployed
into Application Server.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Abhishek Singh
Abhishek Singh

Written by Abhishek Singh

Engineer | Blogger | Traveller

Responses (1)

Write a response