-
Enhancement
-
Resolution: Fixed
-
P3
-
11
-
b10
-
Verified
# Class files
- With --enable-preview, every class file written by javac is a preview class file (minor_version is 65535). Without --enable-preview, every class file written by javac is not a preview class file (minor_version is 0).
- With --enable-preview, javac reads preview class files from the module path/class path as necessary. Without --enable-preview, javac gives an error if it attempts to read a preview class file.
# Diagnostics
- With --enable-preview, if javac detects the use of one or more preview features in source, then javac prints a "note" at the end of the compilation to indicate the use of preview features. Compiling with --enable-preview -Xlint:preview will cause javac to print info about all uses.
* Without --enable-preview, if javac detects the use any preview feature in source, then javac fails with an error. As well as giving the error, javac also mentions that a preview feature was used, and that --enable-preview can be given.
* If a source file depends on one or more preview class files, then javac counts that as a use of a preview feature. Accordingly, javac either gives a "note"/lint warning (with --enable-preview) or an error (without --enable-preview).
- With --enable-preview, every class file written by javac is a preview class file (minor_version is 65535). Without --enable-preview, every class file written by javac is not a preview class file (minor_version is 0).
- With --enable-preview, javac reads preview class files from the module path/class path as necessary. Without --enable-preview, javac gives an error if it attempts to read a preview class file.
# Diagnostics
- With --enable-preview, if javac detects the use of one or more preview features in source, then javac prints a "note" at the end of the compilation to indicate the use of preview features. Compiling with --enable-preview -Xlint:preview will cause javac to print info about all uses.
* Without --enable-preview, if javac detects the use any preview feature in source, then javac fails with an error. As well as giving the error, javac also mentions that a preview feature was used, and that --enable-preview can be given.
* If a source file depends on one or more preview class files, then javac counts that as a use of a preview feature. Accordingly, javac either gives a "note"/lint warning (with --enable-preview) or an error (without --enable-preview).
- blocks
-
JDK-8199193 jshell tool: Add support for preview features
- Closed
-
JDK-8199196 Add javadoc support for preview features
- Closed
- csr for
-
JDK-8200312 Add javac support for preview features
- Closed
- relates to
-
JDK-8202387 javac --release 11 not supported
- Closed
-
JDK-8226585 Improve javac messages for using a preview API
- Resolved
-
JDK-8195734 JEP 12: Preview Features
- Completed
(1 relates to)