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

Deprecate for removal several of the undocumented java launcher options

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • tools
    • None
    • behavioral
    • low
    • Hide
      There are chances that these undocumented options might be in use when launching java. We have seen -ms, -mx options to have been used even within the JDK project, even to this day. That's mostly due to those options being carried over from old code. Unlike previously, after this change, such usages will now see a deprecation message being printed.
      Show
      There are chances that these undocumented options might be in use when launching java. We have seen -ms, -mx options to have been used even within the JDK project, even to this day. That's mostly due to those options being carried over from old code. Unlike previously, after this change, such usages will now see a deprecation message being printed.
    • add/remove/modify command line option
    • JDK

      Summary

      The following non-standard java launcher options will be deprecated now and removed in a future release:

      -verbosegc

      -noclassgc

      -verify

      -verifyremote

      -ss

      -ms

      -mx

      Also, the check for and conversion of -oss option will be removed from the launcher code.

      Problem

      The java launcher has accumulated several outdated, non-standard and undocumented options which it converts to HotSpot JVM specific options before passing control to the JVM.

      Specifically, the launcher currently does the following conversions before passing those options to the JVM:

      -verbosegc      converted to    -verbose:gc
      -noclassgc      converted to    -Xnoclassgc
      -verify         converted to    -Xverify:all
      -verifyremote   converted to    -Xverify:remote
      -ss             converted to    -Xss
      -ms             converted to    -Xms
      -mx             converted to    -Xmx

      Additionally, in the case of -oss option, the launcher converts it to -Xoss and passes it to the JVM. The HotSpot JVM dropped support for the -Xoss option in Java 10 https://bugs.openjdk.org/browse/JDK-8179018 and using java -oss currently throws an error when launching java:

      java -oss Foo
      Unrecognized option: -Xoss
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.

      Solution

      Except for -oss option, the usage of the rest of the options listed above will now print a deprecation warning of the form:

      java -verify Foo
      Warning: -verify option is deprecated and may be removed in a future release.
      ...
      

      (similar warning for rest of the options).

      For -oss option, the launcher will no longer do any specific checks or conversion and this option will be treated just like any other unknown option to the launcher and will result in an error message when launching java:

      java -oss Foo
      Unrecognized option: -oss
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.

      Specification

      None.

            jpai Jaikiran Pai
            dholmes David Holmes
            David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: