How to use Springboot to realize remote debugging in IDEA
This article focuses on "how to use Springboot to achieve remote debugging in IDEA", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use Springboot to achieve remote debugging in IDEA.
First, open Edit configurations and click the + sign to create a Remote application.
Fill in the name and configure the Host address (remote server address) and port (choose an unoccupied port). Then copy the following parameters of For JDK1.4.x. The port configured for the example is 5005:
-Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
After the above steps, you have obtained the parameters to start the remote server. The java command is used by default when starting springboot.
For example, the example project startup command is:
Java-jar test-tool.jar
Then add the parameters obtained above to the startup command at this time:
Java-jar-Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 test-tool.jar
In this way, the server will listen on port 5005. You can check whether the monitoring was successful with the following command:
Netstat-anp | grep 5005
The addition of server-side parameters has been completed through the above steps. Let's start the Remote service just configured, that is, test-tool-remote. At startup, we will find that this startup program only has debug startup mode.
When the startup is complete, hit a breakpoint on the code that requires debug. The remaining operation step is to access the business request corresponding to the remote server, and the local debug will be synchronized. The rest of the operation is the same as the local debug, so I won't repeat it here.
At this point, I believe you have a deeper understanding of "how to use Springboot to achieve remote debugging in IDEA". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!