Unable to open debugger port through IntelliJ

this command worked for me:

export JAVA_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005'

by default idea remote dialog suggest:

'agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'

change it to:

'agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005'

and issues port 5005.


The command to start the remote Java process in debug mode looks correct. If you don't see "Listening to Port blah" when you start the server JAR, then it might mean that the debug args are not being picked up. Another way to quickly check this would be to test with a telnet localhost 5005 on the machine where the server JAR is being executed. The telnet will fail if that port is not being used.

I suggest that you try the following, since the order of the parameters might be significant (I'll add some official evidence for this later):

java "agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" -jar Server.jar