How do I debug my web project in Tomcat from Eclipse?
Author: Deron Eriksson
Description: This Java tutorial describes how to debug a web project in Eclipse without using plug-ins.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.1 || Tomcat 5.5.20


Page: < 1 2 3 4 >

(Continued from page 1)

If you haven't done so already, download TomcatSW. I like to put it at the root level of my C: drive with the version number to make it easy to tell what version of Tomcat I'm currently using. Tomcat can be downloaded from http://tomcat.apache.org/.

Tomcat extracted to C:\apache-tomcat-5.5.20

Next, go to Windows → Preferences, then JavaSW → Build Path → ClasspathW Variables. Create a new classpathW variable called CATALINA_HOME, and set it to your Tomcat directory. Click OK when done. Say OK if EclipseSW wishes to rebuild projects.

CATALINA_HOME Classpath Variable created in Eclipse

Our project needs to be able to see the classes in the Tomcat jarW files, so we need to add the jar files to the project classpath. Right-click the project and go to Properties.

'tomcat-demo' properties

Select Java Build Path on the left and click the Libraries tab. Click the Add Variable... button. In the New Variable Classpath Entry window that pops up, select CATALINA_HOME and then click the Extend... button.

Extending CATALINA_HOME Classpath Variable

Let's add all of the jar files to the classpath that are under CATALINA_HOME/bin, CATALINA_HOME/common/lib, and CATALINA/server/lib. You can use control-click to select multiple jar files at once. When you're done, your libraries should look similar to the following. Click OK when done.

Adding Tomcat jar files to project build path

(Continued on page 3)

Page: < 1 2 3 4 >