Java itself supports debugging features and provides a simple debugging tool--jdb, similar to the powerful Gdb,jdb is also a character interface Debug the environment and support setting breakpoints to support thread-level debugging.
1. In the process startup parameters on the server, add:
-xdebug-xrunjdwp:transport=dt_socket,address=6666,server=y,suspend=n
Connect to the debug service provided by myhost:6666
-xdebug is a notification that the JVM is working 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.
Start the service side
2. Debugging the Client
Set Debug configurations-->remote Java application
3. Click Debug, the effect is as follows, next, and local debugging exactly the same.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
How to remotely debug Java applications in a production environment