1. Environment
Local: windows7
Server: centos7
Remote tomcat: tomcat8.5
Two, placement
Modify the bin/catalina.sh file and add the following code at the beginning:
export JAVA_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000'
Then restart tomcat, centos7 opens port 8000.
Three, IDEA debugging
After the startup is successful, create a new remote debugging in IDEA:
Configure the IP and port, use the IP and that port on the server, as shown in the figure below:
Four, debugging
Just start it in DEBUG mode in IDEA, just like the local debugging mode.