The remote debugging server is a useful technique so that we can quickly locate problems on the line. This article describes how to debug remotely in IntelliJ idea.
Configure IntelliJ idea
Select the edit configurations-->+ number (Add New Configuration)--Remote, as follows:
where host fills in the IP address of the remote server, 8000 is the port for remote debugging.
Server Configuration
Add the following configuration to the setenv.sh in the bin directory of the server Tomcat:
Catalina_opts= "${catalina_opts}-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n"
The first step in the IntelliJ idea configuration is command line arguments for running remote JVM.
Start Remote Debugging
?
after adding breakpoints to the source code, click the Debug button
the Debug window outputs the following content
indicates a successful connection to the remote server and can begin debugging.
Remote debugging with IntelliJ idea