Is it possible to attach Intellij-IDEA debugger to a running java process?
解决方案
Yes! Here is how you set it up.
Run Configuration
Create a Remote run configuration:
Run -> Edit Configurations...
Click the "+" in the upper left
Select the "Remote" option in the left-most pane
Choose a name (I named mine "remote-debugging")
Click "OK" to save:
JVM Options
The configuration above provides three read-only fields. These are options that tell the JVM to open up port 5005 for remote debugging when running your application. Add the appropriate one to the JVM options of the application you are debugging. One way you might do this would be like so:
export JAVA_OPTS="-agentlib