-
Bug
-
Resolution: Fixed
-
P4
-
10, 11, 14, 15, 16
-
b24
-
generic
-
generic
-
Verified
A DESCRIPTION OF THE PROBLEM :
When using `java` in source-file mode (see JEP 330 /JDK-8192920), it displays compiler notes which suggest using options which are only available for `javac`.
This can be quite confusing because it causes an error and it is not directly clear how to use these options correctly.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a file called 'Test.java' containing the source code provided below
2. Run `java ./Test.java`
(i) It suggests using the `-Xdiags:verbose` option
3. Run `java` with that option: `java -Xdiags:verbose ./Test.java`
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
When running `java` in source-file mode and it displays compiler notes recommending the usage of an option, it should mention that this option might only work for `javac`.
ACTUAL -
`java` suggests using `java -Xdiags:verbose`. When using that, an error occurs:
>Unrecognized option: -Xdiags:verbose
>Error: Could not create the Java Virtual Machine.
>Error: A fatal exception has occurred. Program will exit.
---------- BEGIN SOURCE ----------
class Test {
void use(String s) {}
void test() {
// This is wrong on purpose to trigger a compiler error
use(1);
}
}
---------- END SOURCE ----------
When using `java` in source-file mode (see JEP 330 /
This can be quite confusing because it causes an error and it is not directly clear how to use these options correctly.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a file called 'Test.java' containing the source code provided below
2. Run `java ./Test.java`
(i) It suggests using the `-Xdiags:verbose` option
3. Run `java` with that option: `java -Xdiags:verbose ./Test.java`
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
When running `java` in source-file mode and it displays compiler notes recommending the usage of an option, it should mention that this option might only work for `javac`.
ACTUAL -
`java` suggests using `java -Xdiags:verbose`. When using that, an error occurs:
>Unrecognized option: -Xdiags:verbose
>Error: Could not create the Java Virtual Machine.
>Error: A fatal exception has occurred. Program will exit.
---------- BEGIN SOURCE ----------
class Test {
void use(String s) {}
void test() {
// This is wrong on purpose to trigger a compiler error
use(1);
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8268869 java in source-file mode suggests javac-only Xlint flags
-
- Resolved
-