Configure Tomcat in Eclipse.

Configure Tomcat and HSQL in Eclipse:
Required Software:
1. Java SDK 1.7 (Download the Installer)
2. Eclipse Kepler (Download the zip file)
3. Apache Tomcat v7 (Download the zip file)

After download, extract the files into their respective folders, after extraction the directory structure will be as below:

DirStructure

Now invoke ‘eclipse.exe’ from “eclipse” directory, the eclipse will look as below:

eclipseFirst we will configure Tomcat Server, the steps are below:

In the Menu, Window->Show View->Click Servers, the view will be shown bottom of the eclipse.

serversClick on the link to create a new Server. A window will be opened to define the server, then select “Apache->Tomcat v7.0 Server” then click Next.

On the Next Screen, you need select the Tomcat directory i.e., “c:\j2ee\tomcat7”. Also for JRE: select “jdk1.7.0_xx” (If not available, click on the “Installed JREs..” button to configure JDK), then Click Next.

Then Next Screen, there is nothing to do. Then Click Finish. Now Tomcat Server is added to Eclipse, you can see a new project in the Project Explorer. Now we will configure some settings to access Tomcat.

Right-Click on the server, then select properties (as shown below in the Screen):ServerPropOn the Properties screen, click on the “Switch Location”, this is required to get configuration from the Installation directory instead of Eclipse. Click “Ok” to confirm the settings.

In the Project Explorer you will see “Tomcat v7.0 Server at localhost.server” available after the above changes. Double Cick on the Tomcat Server, the screen will look as below:

TomcatSettingsNow select the “Use Tomcat Installation(takes control of Tomcat installation)”. Save the changes and start the Server. This will be done using Servers view, Right-Click on the Tomcat Server and Click on Start.

The Tomcat Server should start successfully, to Test, access “localhost:8080” link in a browser you should see Apache Tomcat Page.

Leave a comment