Idea connects tomcat for debugging

To debug the war package deployed in the independent tomcat, use the idea development tool to remotely connect tomcat. Debug
in the windows environment:

1. Modify the tomcat file ~\bin\catalina.bat:

insert image description here
Add at the beginning:

set CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5555"

Then start tomcat

2. Use idea to open the project source code of the same project as the war package

3. Add a startup configuration

insert image description here

insert image description here
insert image description here
Command parameters (corresponding to the parameter values ​​in catalina.bat, keep consistent):

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

4. After starting the connection, you can normally break the point for debugging

insert image description here

Guess you like

Origin blog.csdn.net/u014438244/article/details/127246683