Remote Debugging in Java
It’s a brief tutorial how to debugging remotely in Java by attaching to running jvm.
-Xdebug: Enables debugging support in the VM
jdwp: Java Debug Wire Protocol
suspend=n : Allows jdb to connect running jvm any time
address: Any process to debug will be connected via the port number written in the address..
We configured our program to accepts debugging requests. The remaining part is about how to connect it. I use IntellijIDEA as Java IDE , so the following part contains IntellijIDEA configuration for remote debugging.
On Run/Debug configuration windows, you can add new Remote Configuration as on the image above. Port should be same with the address on the jvm options. I attached a process that runs locally on my machine, you can override it.