Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8312216

Deprecate for removal the -Xdebug option

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • 22
    • hotspot
    • None
    • behavioral
    • minimal
    • Hide
      In its current form the -Xdebug is effectively a no-op. With the proposed deprecation a warning will be logged if this option is used when launching java. Logging this message will cause applications which use -Xdebug to start seeing this message on their STDERR stream and could be considered unexpected by some applications. That however is no different than other similar warning messages that java command emits for deprecation notices.
      Show
      In its current form the -Xdebug is effectively a no-op. With the proposed deprecation a warning will be logged if this option is used when launching java. Logging this message will cause applications which use -Xdebug to start seeing this message on their STDERR stream and could be considered unexpected by some applications. That however is no different than other similar warning messages that java command emits for deprecation notices.
    • add/remove/modify command line option
    • JDK

      Summary

      java command's -Xdebug option will be deprecated for removal.

      Problem

      java command allows the -Xdebug option to be specified. As noted in the documentation (dating as far back as Java 8), this option is only there for backward compatibility and currently does nothing https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BGBCIEFC

      -Xdebug

      Does nothing. Provided for backward compatibility.

      There are applications which currently pass this option when launching java. Most of these usages are of the form:

      -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

      These usages appear to be copy/pasted and are being used when launching java with debugging enabled. The use of -Xdebug plays no role in launching java in debug mode or any other functionality provided by java.

      Solution

      java launcher will start printing a warning message if -Xdebug is passed. The warning message will state that the option is deprecated and will be removed in a future release:

      java -Xdebug -version
      OpenJDK 64-Bit Server VM warning: Option -Xdebug was deprecated in JDK 22 and will likely be removed in a future release.
      ...

      Specification

      There are no specification changes.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: