On Wed, 3 Jun 2026 17:12:02 GMT, Bill Huang <[email protected]> wrote:

>> make/RunTests.gmk line 889:
>> 
>>> 887:     $1_JTREG_BASIC_OPTIONS += -vmoption:--enable-preview
>>> 888:     $1_JTREG_BASIC_OPTIONS += -javacoption:-XDaccessInternalAPI
>>> 889:     $1_JTREG_BASIC_OPTIONS += -javacoption:--source 
>>> -javacoption:$(VERSION_FEATURE)
>> 
>> Is this really necessary? Wouldn't the current feature version be the 
>> default value for `--source`, or is there some interaction with 
>> --enable-preview that requires it to be paired with `--source`?
>
> Yes, I think it is necessary. javac may default to the current source level 
> normally, but once --enable-preview is present, javac requires the source 
> level to be explicit. Otherwise it exits with:
> 
>   error: --enable-preview must be used with either -source or --release

See the following bug comment for my analysis:
https://bugs.openjdk.org/browse/JDK-8385743?focusedId=14885774&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14885774

Summary: I believe this comment is resolved.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3384513671

Reply via email to