[lworld] RFR: 8372515: [lworld] Plumb in javac flags for compiling with preview mode [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Dec 10 10:14:03 UTC 2025


On Tue, 9 Dec 2025 22:29:15 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove note about StableValue (not possible)
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java line 819:
> 
>> 817: 
>> 818:     MULTIRELEASE("--multi-release", "opt.arg.multi-release", "opt.multi-release", HIDDEN, FILEMANAGER),
>> 819:     PREVIEWMODE("--preview-mode", "opt.arg.preview-mode", "opt.preview-mode", HIDDEN, FILEMANAGER),
> 
> I'm not 100% sure as to why we're adding a new preview option here -- javac already has `--enable-preview` -- what is the new option for? Seems to be only used by the file manager. Can't the file manager use `--enable-preview` ? @david-beaumont  or @lahodaj  please clarify

OK, I see -- this is an "hidden" option, just used internally by javac to communicate to the file manager whether preview mode should be enabled or not. I now see the same pattern being used as that for multirelease jars.

-------------

PR Review Comment: https://git.openjdk.org/valhalla/pull/1761#discussion_r2606014344


More information about the valhalla-dev mailing list