"Environment Parameters"
Eclipse:version:mars.2 Release (4.5.2)
Linux:centos 6.5
Brief
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 set breakpoints, support thread-level debugging.
"Concrete Steps"
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
Attention:
Before clicking the "Debug" button, be sure to " start the program ", otherwise it will appear
"Failed to connect to remote VM. Connection refused "exception, as shown in.
3. Click Debug, the effect is as follows, next, and local debugging exactly the same.
Requires an HTTP client-initiated request, such as the poster plugin for Firefox, or JUnit's test cases, and so on.
Eclipse Remote Debug