1. JVM parameters must be added to remote side boot
-xdebug-xrunjdwp:transport=dt_socket,suspend=n,server=y,address=${debug_port}
Where Debug_port is the custom debug port
2.
Local connection remote server debug port
Open IntelliJ idea, in the top right place select "Edit configurations ...", go in and click on the + number, select "Remote", followed by just fill in the contents of the red box, where host is the remote code to run the machine ip/hostname, Port is the debug_port specified in the previous step, this example is 5555
Then click Apply and then click OK
Start Debug mode
Now in the previous step select "Edit configurations ..." drop-down box location Select the remote name created in the previous step, then click on the Debug button on the right (long as the bug that), look at the console log, if there is a similar "Connected to the Target VM, Address: ' xx.xx.xx.xx:5555 ', Transport: ' socket ' , means the connection was successful.
Set breakpoints, start debugging
The remote debug mode is turned on and can now break points in the code that needs to be debugged, such as:
, if there is a yes in the breakpoint, the selected breakpoint is correct.
Now send a local request to the remote server, look at the local console bug interface, to debugger this tab, you can see the current remote service's internal state (various variables) has been shown, and at the point where the breakpoint was just set, also shows the value of the row variable.
Java Remote Debugging