First, the service side settings
1, the first way
Enter the bin directory and execute:./catalina.sh JPDA Start
if[" $"="JPDA"] ; Then if[-Z"$JPDA _transport"]; ThenJpda_transport="Dt_socket" fi if[-Z"$JPDA _address"];Then
# Portjpda_address="8686" fi if[-Z"$JPDA _suspend"]; ThenJpda_suspend="N" fi if[-Z"$JPDA _opts"]; Thenjpda_opts="-agentlib:jdwp=transport= $JPDA _transport,address= $JPDA _address,server=y,suspend= $JPDA _suspend" ficatalina_opts="$CATALINA _opts $JPDA _opts" Shiftfi
Because the catalina.sh script has the above command, you can start with the command directly.
2, the second way
Configure the following parameters in the catalina.sh script:
Java_opts= "-xdebug-xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
Then go to the Bin directory and execute directly:./startup.sh
Parameter description:
-xdebug is to notify the JVM to work in debug mode;
-XRUNJDWP is to inform the JVM to use (Java Debug wire protocol) to run the debugging environment. This parameter also has a series of debugging options:
Transport specifies how the debug data is routed
Dt_socket refers to using the socket mode
server=y/n whether the VM needs to be executed as a debug server.
suspend=y/n whether to start the VM after the debugging client establishes a connection.
Second, Eclipse configuration debug
1. Open debug Debug Configurations in Eclipse, set the remote IP and port to be debugged, as below.
Port fill in the corresponding port of your modified jpda_address, then click Debug to be able to debug remotely.
Eclipse Remote Debug