Easy learning with example program codes

How to create WAR file in eclipse?

What is war file?

WAR stands for Web application Archive. WAR is a compressed file format like the ZIP file which includes jsp, servlet, jar and static web resources etc in a specific hierarchical directory structure called WEB-INF. It is like jar file but follow a specific hierarchical directory structure. WAR files are deployed to the application server like Tomcat or Java EE server like JBoss etc.

Note: WAR files have the .war extension and contains the whole web application.

How to create WAR file in eclipse?

Let us discuss it with an example. We are creating a java project which contain one class The contains one static method armstrong(int num) which returns true if the num is an armstrong number otherwise returns false. We will create the JAR file of this and use JAR file in other project.

Step 1: Right click on the project and click on Export.


Step 2: Select the WAR file and click on Next.


Step 3: Enter the destination and click on Finish.


Related Topics:

How to build java project using ant in eclipse?
JAXB marshalling – convert java object to xml example.
How to create pdf file in java using iText jar?
Generics class example.
OGNL in struts 2.
Hibernate One-to-One Mapping using xml.
Send inline image in email using JavaMail API.
Quartz 2 JobListener example.


Posted in War   

WAR Tutorial

Create war file in eclipse.
Create war file using ant.

(adsbygoogle = window.adsbygoogle || []).push({});
Sign Up/ Sign In
Ask a Question

Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2018 CodesJava Protection Status SiteMap Reference: Java Wiki