JDK-8198793 : Add launcher support for preview features
  • Type: Enhancement
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 11
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2018-02-27
  • Updated: 2018-04-30
  • Resolved: 2018-04-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b11Fixed
Related Reports
Blocks :  
CSR :  
Relates :  
Relates :  
Sub Tasks
JDK-8201653 :  
Description
With the new proposal the launcher boolean flag "--enable-preview" is passed as-is to
the VM as it stands now for example:

% _JAVA_LAUNCHER_DEBUG=true java --enable-preview --help

<lots of debugging traces deleted for clarity>
JavaVM args:
    version 0x00010002, ignoreUnrecognized is JNI_FALSE, nOptions is 4
    option[ 0] = '-Dsun.java.launcher.diag=true'
    option[ 1] = '--enable-preview'
    option[ 2] = '-Dsun.java.launcher=SUN_STANDARD'
    option[ 3] = '-Dsun.java.launcher.pid=21039'
Comments
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-April/052544.html
11-04-2018

diff --git a/src/java.base/share/classes/sun/launcher/resources/launcher.properties b/src/java.base/share/classes/sun/launcher/resources/launcher.properties --- a/src/java.base/share/classes/sun/launcher/resources/launcher.properties +++ b/src/java.base/share/classes/sun/launcher/resources/launcher.properties @@ -113,6 +113,8 @@ \ one or more argument files containing options\n\ \ -disable-@files\n\ \ prevent further argument file expansion\n\ +\ --enable-preview\n\ +\ allow classes to depend on preview features of this release \To specify an argument for a long option, you can use --<name>=<value> or\n\ \--<name> <value>.\n
11-04-2018

diff --git a/src/java.base/share/classes/sun/launcher/resources/launcher.properties b/src/java.base/share/classes/sun/launcher/resources/launcher.properties --- a/src/java.base/share/classes/sun/launcher/resources/launcher.properties +++ b/src/java.base/share/classes/sun/launcher/resources/launcher.properties @@ -113,6 +113,8 @@ \ one or more argument files containing options\n\ \ -disable-@files\n\ \ prevent further argument file expansion\n\ +\ --enable-preview\n\ +\ allow classes to depend on preview features of this release \To specify an argument for a long option, you can use --<name>=<value> or\n\ \--<name> <value>.\n
11-04-2018

This should be sufficient as a proto-type, if this is all there is to it, then it needs to be formalized as a supported option by the launcher for which a CSR would be needed at that time.
07-03-2018