Reference

WAR (Java web archive)

A WAR (Web Application Archive) is a ZIP-based package that bundles a Java web application — its code, pages, and configuration — into one file for deployment to a Java application server like Tomcat.

Files & formatsGeneral

WAR (Java web archive)

Also known as: WAR file, .war archive, Java web application archive

A WAR (Web Application Archive) is a ZIP-based package that bundles a Java web application — its code, pages, and configuration — into one file for deployment to a Java application server like Tomcat.

  • ZIP-based package for a Java web application
  • Deployed to servers like Tomcat or Jetty
  • Related to JAR, but specific to web apps

A packaged web app

A WAR file collects everything a Java web application needs — compiled classes, libraries, web pages, and configuration — into a single archive. Under the hood it is a ZIP with a defined internal layout.

It is a cousin of the JAR (Java Archive): JAR packages general Java programs and libraries, while WAR specifically packages web applications.

How WAR files are used

You deploy a WAR by dropping it into a Java servlet container or application server (such as Tomcat or Jetty), which unpacks and runs it. Because it is ZIP-based, archive tools can also open one to inspect the contents.

Related terms

Keep reading the reference.