Starting Tomcat with remote debugging (jdwp) when installed as a windows service

ripper234 picture ripper234 · Sep 10, 2009 · Viewed 9.3k times · Source

I have a Tomcat installed as a Windows service. I'd like to configure it to support remote debugging via jdwp.

When starting it from the command line (catalina.bat), I can add this string to allow debugging:

-agentlib:jdwp=transport=dt_socket,suspend=n,server=y,address=10000

Where can I added jdwp support when running it as a windows service? For the purpose of this question, I do not want to use the "Monitor Tomcat" application, but rather configure it via some file like server.xml, catalins.properties, etc ...

Answer

prilia picture prilia · Feb 21, 2016

Steps to start Tomcat windows service in Debug mode:

1) Go to Directory under Tomcat bin folder
2) C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\bin
3) Run tomcat7w.exe
4) Under Java/ Java Options, enter lines above all the -D options
-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Make sure the above 2 lines are in separate lines