JDK-8200528 : Add launcher support for preview features
  • Type: CSR
  • Component: tools
  • Sub-Component: launcher
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 11
  • Submitted: 2018-03-30
  • Updated: 2018-04-10
  • Resolved: 2018-04-09
Related Reports
CSR :  
Relates :  
Description
Summary
-------
Update the java launcher to support the use of "preview" features.

Problem
-------

JEP 12 [1] describes JDK support for "preview" language and VM features.The launcher
should support this as a documented flag.


Solution
--------

The launcher will support the flag "--enable-preview" and make it available to the Java
Virtual Machine, and advertise it  via its help/man pages.

Specification
-------------

New option:
    --enable-preview  allow classes to depend on preview features of this release.

---
[1] http://openjdk.java.net/jeps/12


Comments
Moving to Approved.
09-04-2018

Other launchers would have to pass this option through the JNI invocation API. All this bug/csr is saying to the users of the JDK's launcher that the option can be passed to the underlying VM, and the JDK launcher supports this option.
09-04-2018

To paraphrase a question asked in a comment on JDK-8200440: "Add JVM support for preview features", what standardized way, if any, if created for other launchers to enable preview features?
09-04-2018

The VM spec is reasonable as it needs to support other launchers besides the java launcher, and the java launcher requires to advertise its available to the JDK users, so after some internal discussions, I am moving this forward in the CSR pipeline.
05-04-2018

I don't want to tie the help message to a version, I prefer the latter meaning "allow classes to depend on preview features of this release"
02-04-2018

Is "New option: --enable-preview enable runtime preview features." intended to describe the new help text? There is no such thing as a "runtime preview feature". JEP 12 discusses "preview VM features" as distinct from "preview language features", but I don't think "preview VM features" is helpful for general help text. Ideally the help text would spell out that the features exist for the current version -- "enable preview features of Java SE 11" for the launcher in JDK 11 -- but if this is not possible then "allow classes to depend on preview features of this release".
02-04-2018