Remote debugging feature is provided by Java specification itself. Java provides this feature using listener binding mechanism. Basic concept is pretty simple and straightforward:
  • Application to be debugged would attach a socket to itself and then would listen debug instructions on that socket.
  • Debugger would bind itself to that socket and then send instructions on that socket.

JVM arguments for DEBUGGING:
  • For JVMs prior to 1.5:
    One need to supply two arguments, -Xdebug and -Xrunjdwp. -Xdebug tells JVM to run the application in debug mode, while -Xrunjdwp is used to supply debug parameters (It can also be used in JVM 1.5 or 1.6 as well)
    e.g. -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
  • For JVMs 1.5 and 1.6:
    Debug library is passed as -agentlib argument, along with debug paramters. Native library name for debugging is jdwp, so one need to supply -agentlib:jdwp along with debug paramters.
    e.g. -agenlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

Sandeep Joshi
Mathematics, Technology and Programming are my passion. I am a part of Java Ecosystem and through this blog, I contribute to it. I am here to blog about my interests, views and experiences.
I am on Google+ and Facebook.
I feel proud to be listed as a "National Memory Record Holder" in the Limca Book of Records, 2009 and have attempted for an International Memory record in the Guiness Book of Records. I can remember the value of PI upto 10,000 digits after the decimal (3.1415.....). You can contact me on ; I would like to hear from you :)