Java itself supports debugging and provides a simple debugging tool--jdb, similar to the powerful Gdb,jdb is also a character interface debugging environment, and support the setting of breakpoints, support thread-level debugging.
1. Add to the process startup parameters on the server:
-xdebug-xrunjdwp:transport=dt_socket,address=6666,server=y,suspend=n
Connecting to the debugging services provided by myhost:6666
-xdebug is to notify the JVM to work in debug mode,
-XRUNJDWP is to notify 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 debug data is transmitted
Dt_socket refers to the use of socket mode
Whether the server=y/n VM needs to be executed as a debug server.
suspend=y/n whether to start the VM after the debugging client establishes a connection.
Start the service side
2. Debugging clients
Set Debug configurations-->remote Java application
3. Click Debug, the operating effect is as follows, and the local debugging is exactly the same.