First, the configuration
1. CD Apache-tomcat/bin
2. VI startup.sh File
3. At the beginning of the file, add the code below (address represents the debug port)
Declare-x catalina_opts= "-xdebug-xnoagent-djava.compiler=none-xrunjdwp:server=y,transport=dt_socket,suspend=n, address=35533 "
4. Restart Tomcat
Second, use
1. Open the debug configurations of Eclipse and create a new remote Java application
2. Enter host IP for the debug service
3. Enter port, debug port for debug service (this example is 35533)
4, click on Debug, in the required business code on the breakpoint can be debugged
Third, about the JVM parameters
-xdebug:
Enable debugging.
-xrunjdwp:<name1>[=<value1>],<name2>[=<value2>, ... :
Load the JVM's JPDA reference implementation library.
server (is "Y" or No "n"):
such as "Server=y", received a debugging application to attach, such as "server=n", attached to the specified address of the debugging application.
Address:
Connect the delivery address. If server=n, try to attach to this address to debug the application, such as Server=y, receive the connection to this address.
Timeout:
If server=y, it specifies, in milliseconds, the time to wait for the debugger to attach, such as server=n, which specifies the time in milliseconds to attach to the debugger.
Suspend:
If "yes", the JVM defers execution until the debugger connects with the JVM being debugged.
Eclipse Configuring Remote Debugging