4 May 2015

Setup Tomcat in Eclipse

Here's a quick step by step tutorial to setup Tomcat in Eclipse.
  • Go to Tomcat Downloads Page and download it.
  • Extract the downloaded zip file into a directory.
  • Open Eclipse, under servers tab click on create a new server link as shown:
  • On clicking it we will get a New Server popup window to define a new server. As we are trying to setup Tomcat so select corresponding server type and version under Apache as shown:
    Define a New Server
  • Then click on Next, we will get a popup window to specify Tomcat Installation directory as shown. Click on Browse and select the Tomcat Installation/Home directory (extracted folder). Also, you can specify any of the installed jre's for the Tomcat to use.
    Tomcat Home Directory
  • Finally click on Finish to complete Tomcat setup in Eclipse.

Run Tomcat in Eclipse

Under servers tab, right click on Tomcat Server we will get a popup menu as shown.
Tomcat - Start
Click on Start so that server gets started and we can find some servers log in console tab as shown.


Here, we can find the last log which indicates server has started in 626 ms.

Verifying Tomcat Setup

Open a browser and try to access http://localhost:8080/. We should find Tomcat page as shown.

In case if you are facing HTTP Status 404 - / error message then you need to make a couple of changes as:
  • Stop the server if running. Then right-click on it and select Properties we will get a pop-up window as shown.
    Click on Switch Location option and click OK to save the changes.
  • Then double-click on Tomcat server under servers tab we will get Tomcat configuration settings. Under server locations select 'Use Tomcat installation' option as shown and save the changes.
Now try to access http://localhost:8080 you will be able to find Tomcat page as shown above.





Popular Posts

Write to Us
Name
Email
Message