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

Deprecate for removal the -Xnoagent option

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 22
    • hotspot
    • None
    • behavioral
    • minimal
    • Hide
      In its current form the -Xnoagent 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 -Xnoagent 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 -Xnoagent 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 -Xnoagent 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 -Xnoagent option will be deprecated for removal.

      Problem

      java command currently allows the -Xnoagent option. The implementation currently ignores this option and provides no functionality for it. This option isn't documented (doesn't appear in help text nor in its man page).

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

      -Xdebug -Xnoagent -Djava.compiler=NONE -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 -Xnoagent in recent versions of the JDK 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 -Xnoagent is passed. The warning message will state that the option is deprecated and will be removed in a future release:

      java -Xnoagent -version                 
      OpenJDK 64-Bit Server VM warning: Option -Xnoagent 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
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: