javaremote-debuggingjdwp

Can I know jdwp transport port from inside JVM?


I am starting java with the following arguments:
-Xdebug -Xrunjdwp:transport=dt_socket,address=0,server=y,suspend=n
and I get the following output:
Listening for transport dt_socket at address: 59183

Is it possible to find the port from inside the same JVM, without reading standard output?


Solution

  • Why are you setting the port to 0? Typically you would use the address parameter to set the port to whatever you want.

    http://download.oracle.com/javase/1.4.2/docs/guide/jpda/conninv.html