I came to know of the remote debugging procedure under Idea recently. What I do is copy the configuration of remote debug under Run | Debug Configuration in Idea to the command line java execution parameters. The actual command line parameters are:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
If it is a script, I add these commands to it. By doing so, the command line displays the message:
Listening for transport dt_socket at address: 8000
So the debugging can happen using the local source code. However, I don't properly understand how remote debugging work. Anyone who knows how remote debugging actually works, please give me an explanation.
Thank you!
Connect via SpaceLaunch IntelliJ IDEA. On the starting page, select JetBrains Space and click Connect to Space. Enter your organization URL and click Continue in Browser. In the browser window that opens, click Accept to grant the required permissions.
Press Ctrl+Alt+F5 or choose Run | Attach to Process from the main menu. IntelliJ IDEA will show the list of the running local processes. Select the process to attach to. The processes launched with the debug agent are shown under Java.
You can launch an SSH Session right from IntelliJ IDEA. By running commands in a dedicated SSH terminal, you can access data on a remote Web server or a Vagrant instance (virtual machine) via an SSH tunnel, mainly upload and download files.
Remote debugging means that you can run your Java code anywhere, either on the local or remote machine. When it's running in the debug mode, you can connect to it from the IDE using TCP network connection and perform debugging. IDE needs to have the source code for the running classes so that you can place breakpoints inside this code and perform stepping, inspecting variables, etc.
If you are interested in technical details, refer to the JPDA documentation.
Consider a scenario where you want to fix something in your application but your application only can run over a server machine because of other dependencies. That is where Remote Debugging come into picture. You Just connect the sever by providing the hostname and port and connect it with your respective environment.
How It works:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With