<p>I would like to debug my separately running JSP/Struts/Tomcat/Hibernate application stack using the Eclipse IDE debugger. How do I setup the java JVM and eclipse so that I can set breakpoints, monitor variable values, and see the code that is currently executing?</p>

[{'answer_id': 67888, 'author': 'DustinB', 'author_id': 7888, 'author_profile': 'https://Stackoverflow.com/users/7888', 'pm_score': 3, 'selected': False, 'text': '<p>I just Googled it.  :)</p>\n\n<p><a href="http://bugs.sakaiproject.org/confluence/display/BOOT/Setting+Up+Tomcat+For+Remote+Debugging" rel="noreferrer">http://bugs.sakaiproject.org/confluence/display/BOOT/Setting+Up+Tomcat+For+Remote+Debugging</a></p>\n\n<p>Many more on google.</p>\n\n<p>Effectively, set your JPDA settings:\nset JPDA_ADDRESS=8000\nset JPDA_TRANSPORT=dt_socket\nbin/catalina.bat jpda start</p>\n\n<p>Then, in Eclipse, Run->Debug Configurations...->Remote Applications.</p>\n'}, {'answer_id': 67927, 'author': 'Dónal', 'author_id': 2648, 'author_profile': 'https://Stackoverflow.com/users/2648', 'pm_score': 1, 'selected': False, 'text': "<p>Follow these steps:</p>\n\n<ol>\n<li><p>Add the following arguments to the <code>java</code> command that is used to launch Tomcat (on Windows, I think this is in TOMCAT\\bin\\catalina.bat)</p>\n\n<p>-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n</p></li>\n<li><p>In Eclipse, create a 'Remote Java Application' debug configuration and set the port to 8787 and the host to the name (or IP address) of the machine where Tomcat is running. If Tomcat is running on the same machine as Eclipse, use 'localhost'.</p></li>\n<li><p>In the 'source' tab of the debug configuration, add any projects that you want to debug into</p></li>\n<li><p>Start Tomcat</p></li>\n<li><p>Launch the debug configuration you created in step 2</p></li>\n<li><p>Eclipse should now stop at any breakpoints that you've set in the projects you added in step 3.</p></li>\n</ol>\n\n<h2>Notes:</h2>\n\n<ul>\n<li>You can change the port to any other available port if for some reason you can't use 8787</li>\n<li>If you want Tomcat to wait for the remote debugger to start, use 'suspend=n' in the command above to 'suspend=y'</li>\n</ul>\n"}, {'answer_id': 68310, 'author': 'MetroidFan2002', 'author_id': 8026, 'author_profile': 'https://Stackoverflow.com/users/8026', 'pm_score': 1, 'selected': False, 'text': '<p>You could do what they suggest, or use this Eclipse plugin, which makes it easier to configure Tomcat to begin with: <a href="http://www.eclipsetotale.com/tomcatPlugin.html" rel="nofollow noreferrer">Eclipse Tomcat Plugin</a></p>\n\n<p>When launching tomcat via this plugin, it starts in debug mode by default, you must explicitly disable debugging mode if you want it to not allow Eclipse to connect a remote debugger.</p>\n'}, {'answer_id': 198801, 'author': 'Jeremy Stein', 'author_id': 9702, 'author_profile': 'https://Stackoverflow.com/users/9702', 'pm_score': 1, 'selected': False, 'text': '<p>For Tomcat 5.5 on Windows:</p>\n\n<p>Edit bin/startup.bat</p>\n\n<p>Find the line that reads:</p>\n\n<pre>call "%EXECUTABLE%" start %CMD_LINE_ARGS%</pre>\n\n<p>Replace it with these lines:</p>\n\n<pre>set JPDA_ADDRESS=8000\nset JPDA_TRANSPORT=dt_socket\ncall "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%</pre>\n'}]
['https://Stackoverflow.com/questions/67810', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10402/']