
Creating Java WebArchives for Apache Tomcat
Packaging Java webapps into WebArchives.
1 min read
For easier handling, Java web applications can be packaged into .war files (“Web Archives”). This requires the Java Development Kit (JDK), which is installed in %JAVA_HOME% on every Tomcat server.
The command “jar.exe cf webAppName.war” “packages” a web application.
Example:
cd C:\webapps\test
%JAVA_HOME%\bin\jar.exe cf ..\test.war *
This packages the webapp in the directory “C:\webapps\test” into the archive test.war and puts it in the “webapps” folder.