Ref. JEP 12 - Preview Language and VM Features

Alan Bateman Alan.Bateman at oracle.com
Wed Mar 7 10:11:07 UTC 2018


On 07/03/2018 01:49, Alex Buckley wrote:
> On 3/6/2018 5:00 PM, David Holmes wrote:
>> The JEP defines a "launcher flag" --enable-preview but it is unclear
>> whether this is truly a launcher flag or a VM flag? Is the VM expected
>> to process the --enable-preview flag and accept it via the JNI
>> invocation API? Or does the launcher translate --enable-preview into a
>> suitable -XX VM flag?
>>
>> If the above is considered too implementation oriented for the JEP then
>> at a minimum the JEP needs to clarify whether you can enable preview
>> features via the JNI invocation API.
>
> Let's proceed by assuming that you cannot enable preview features via 
> the JNI Invocation API.
I think it would be better to start with having it supported in the VM 
as the VM needs to act on it anyway. This avoids the need for the java 
launcher to do translation and makes it consistent for the corner case 
that is custom launchers using JNI CreateJavaVM. It would also be 
consistent with the runtime options that we added in JDK 9, these can 
all be specified via the JNI invocation API too.

-Alan


More information about the jdk-dev mailing list