Big factories used to use IDEA remote debugging in this way!

Remote debugging is an important technology, especially for developers using IDEA. In this technical blog, we will discuss how to use IDEA for remote debugging.

1 IDEA placement

First, we need to make sure our development environment is ready. We need to install and configure a debugger, such as GDB or LLDB, on the remote server. We also need to install IDEA on the local computer and make sure our code has been correctly imported into IDEA.

Next, we need to create a remote debugging configuration. In IDEA, we can create a new configuration by selecting the "Edit Configurations" option in the "Run" menu. Under the "Remote" tab, we need to specify the IP address and port number of the remote server, and select the type of debugger we are using.

Once configured, a remote debugging session can be started. In IDEA, we can start a debugging session by selecting the "Debug" option in the "Run" menu. IDEA will connect to the remote server and open a debugger window on the local computer.

Now we can start debugging. I

It can be seen that you can only debug at this time, but not run:

We can set breakpoints, watch variables, and execute code just as we would on our local computer. During debugging, IDEA will display variables and stack information on the remote server and allow us to control the execution flow of the program.

2 Remote service configuration

Please restart the JVM service:

JDK5-8 writing method

java -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=\*:5005 -jar 

JDK9+ writing method

java -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=\*:5005 -jar 

Summarize

In conclusion, remote debugging is a very useful technology that can help us diagnose and solve problems quickly. Remote debugging with IDEA is a relatively simple and powerful method that can help us develop and maintain our applications faster. Hope this technical blog can help you!

Guess you like

Origin blog.csdn.net/qq_33589510/article/details/132052612