Summary
The java
launcher will no longer support the following 6 options:
-t
-tm
-Xfuture
-checksource
-cs
-noasyncgc
Problem
The code in the java
launcher has accumulated support for some outdated launcher options. Depending on the option, the launcher code either prints a unsupported/deprecated warning and ignores the option or will transform the option to something else and pass it along to the JVM to let it process that option.
Specifically, for the -t
and -tm
options the launcher code will convert them to -Xt
and -Xtm
and pass them along to the JVM. However, neither of these options are supported by the JVM and launching java
with either of these 2 options currently leads to an error during launch:
java -t Foo
Unrecognized option: -Xt
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
(similar output for -tm
)
For the -checksource
, -cs
and -noasyncgc
options, the launcher just prints a warning stating that the option is unsupported and ignores those options:
java -cs Foo
Warning: -cs option is no longer supported.
...
(similar output for -checksource
and -noasyncgc
)
These -checksource
, -cs
and -noasyncgc
options haven't been supported since Java 1.2 days, so these are extremely outdated options.
For the -Xfuture
option, the launcher converts it to -Xverify:all
and passes it to the JVM. At the same time it prints a deprecation warning. This option was deprecated in Java 13 through https://bugs.openjdk.org/browse/JDK-8215156
java -Xfuture Foo
Warning: -Xfuture option is deprecated and may be removed in a future release.
Solution
The java
launcher code will be updated to remove checks for these options and the launcher will no longer provide any specific support for them. They will be treated just like any other unknown option and if used while launching java
will result in an error causing the launch to fail.
Specification
diff --git a/src/java.base/share/man/java.1 b/src/java.base/share/man/java.1
index 58e4faf17c348..da7fb86099f5a 100644
--- a/src/java.base/share/man/java.1
+++ b/src/java.base/share/man/java.1
@@ -3749,12 +3749,6 @@ future JDK release.
They\[aq]re still accepted and acted upon, but a warning is issued when
they\[aq]re used.
.TP
-\f[V]-Xfuture\f[R]
-Enables strict class-file format checks that enforce close conformance
-to the class-file format specification.
-Developers should use this flag when developing new code.
-Stricter checks may become the default in future releases.
-.TP
\f[V]-Xloggc:\f[R]\f[I]filename\f[R]
Sets the file to which verbose GC events information should be
redirected for logging.
@@ -3920,6 +3914,16 @@ of objects reachable from the old generation space into the young
generation space.
To disable GC of the young generation before each full GC, specify the
option \f[V]-XX:-ScavengeBeforeFullGC\f[R].
+.TP
+\f[V]-Xfuture\f[R]
+Enables strict class-file format checks that enforce close conformance
+to the class-file format specification.
+Developers should use this flag when developing new code.
+Stricter checks may become the default in future releases.
+.RS
+.PP
+Use the option \f[V]-Xverify:all\f[R] instead.
+.RE
- csr of
-
JDK-8339918 Remove checks for outdated -t -tm -Xfuture -checksource -cs -noasyncgc options from the launcher
-
- Resolved
-