Enable Remote Debugging From Tomcat 7 In Windows

Overview

Tomcat Configuration

Ensure Tomcat is not running before making any changes.
Add the following in the first free line that’s not commented out to the file tomcat\bin\startup.bat:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket

For example from:
rem $Id: startup.bat 895392 2010-01-03 14:02:31Z kkolinko $
rem ---------------------------------------------------------------------------

rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"

to:
rem $Id: startup.bat 895392 2010-01-03 14:02:31Z kkolinko $
rem ---------------------------------------------------------------------------

rem Enable remote debugging
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket

rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"

Modify the last line from
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
to
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

Eclipse

Start Eclipse IDE.

Debug Configurations Menu
Go to Run > Debug Configurations…

New Remote Java Application
Right click on Remote Java Application from the menu on the left and select New.

Enter the following:

Click the Apply button to save it. Press the Close button to make the dialogue disappear.

Go to the Debug perspective from Window > Open Perspective > Debug. If Debug is not listed, go to Other… and find it from the list.

Summary

It’s fairly simple to enable but it’s odd that the changes have to be made in the startup script rather than a configuration item.

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Java, Windows and tagged , , . Bookmark the permalink.

One Response to Enable Remote Debugging From Tomcat 7 In Windows

  1. bharath says:

    i’m this issue. I tried what you mentioned above and I’m still having the issue. Could you please help me with this.

Leave a Reply

Your email address will not be published. Required fields are marked *.

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.