Profile Image
vishnupriya

What is Java Debug Option (Obsolete): -Xdebug?

What is Java Debug Option (Obsolete): -Xdebug? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvm-argument

  • xdebug

  • debug

  • Java Debug Option

  • obsolete

  • Java Virtual Machine Debug Interface

  • JVMDI

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:


• -Xdebug


Description:


Prior to Java 1.6 the -Xdebug option was used to turn on remote debugging
using the Java Virtual Machine Debug Interface (JVMDI).


Since Java 1.6 this command line argument does nothing at all, and is only
included for backwards compatibility.


To debug an application running on a modern Java version, use a Java Agent
that implements the Java Debug Wire Protocol (JDWP). Such an agent can be
setup and configured using the -agentlib option. You will also need a JDWP
client to connect to the target Java runtime. For this purpose the jdb took
supplied with the JDK can be used, however most developers will find it more
convenient to use the debugging built into their IDE. All good Java IDEs provide
debugging capability, and will usually be able to automatically configure the
parameters for the target runtime also.


Default Value:


Prior to Java 1.6 -Xdebug was off by default.
Since Java 1.6 -Xdebug does nothing and therefore has no meaningful default.


Errors:


None.


Arguments Related to -Xdebug:


TODO: link to -Xrunjdwp TODO: link to -agentlib


Related Posts:


• Usage instructions for the jdb debugging tool.


NOTE:

If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your
insights will help the entire 10+ million java developer community to develop
one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm-argument

  • xdebug

  • debug

  • Java Debug Option

  • obsolete

  • Java Virtual Machine Debug Interface

  • JVMDI