WAR File and its deployment in Java

Step 1 : Right Click on Project -> Export

Create WAR File of Project in Eclipse

Step 2 : In Search tab -> WAR file -> Next

Create WAR File of Project in Eclipse

Step 3 : Select Destination/Location for WAR file and select Tomcat version for deployment and at last click Finish.

Create WAR File of Project in Eclipse

Create WAR File of Project in Eclipse

Create WAR File of Project in Eclipse

You can see below the WAR file ServletDemo.war is created on selected location.

Create WAR File of Project in Eclipse

Step 1 : Start Tomcat Server (e.g. Tomcat 8.5)

Deploying WAR File using Tomcat

Deploying WAR File using Tomcat

Step 2 : Open Home Page of Tomcat

Deploying WAR File using Tomcat

Step 3 : Clicking on Manager App Button will redirect to following page.

Deploying WAR File using Tomcat

Scroll down you will see deploy section :

Deploying WAR File using Tomcat

Step 4 : In War File to Deploy browse your war file and click on deploy.

Deploying WAR File using Tomcat

After successfully deployment message will come OK.

Deploying WAR File using Tomcat

Step 5 : Now Restart Your Server or shutdown and start again. And you can open/run your project.