JDK9 Incubator Module

This article is an article on 12/18 of Fujitsu Advent Calendar. In December, the Incubator Module was suddenly registered as OpenJDK JEP 11. This article gives a brief introduction to this Incubator Module.

What is Incubator Module?

To put it simply, the Incubator Module is not a formal Java SE specification, but it is a module that is included in OpenJDK as a trial version. Currently, HTTP / 2 etc. are candidates.

This JEP11 has two differences from other JEPs.

One was said "suddenly" at the beginning, but in the JEP2.0 process, it is usually discussed on mailing lists etc. before the status becomes Candidate (entering the OpenJDK roadmap). However, it seems that there was nothing in particular this time.

The other is that the number is 11. JEP numbers are numbered from 101 and currently number 302. (No. 1 is JEP itself, No. 2 is a template, and numbers 3 to 100 are missing numbers.) If it is a new JEP, it should be No. 303, but No. 11 which has not been used so far is assigned. I have.

The reason for this is common to these two points, because the Incubator Module is an Informational JEP, not a Feature JEP. Informational JEP became Candidate without any special discussion because it does not follow the workflow of Feature JEP, and the number is also different from Feature JEP. However, there are other Information JEPs so far, and 101 and later are used. (Example JEP 188: Java Memory Model Update)

specification

The Incubator Module has a limited lifetime and will be removed if its functionality is not standardized by the JCP.

The module name of the Incubator Module is "jdk.incubator.xxx".

Incubator functionality is only exported from the Incubator Module. In the future, when this feature is standardized, the package name will change and it will be exported from modules other than the Incubator Module. The Incubator Module and its API may disappear, in which case the "@Deprecated" annotation should not be added. It is a different concept from Deprecated. Therefore, you should take the risk of future incompatibilities when using the Incubator Module.

The Incubator Module can only export the Incubator function, not the "java." Or "javax." APIs. The Incubator Module cannot export APIs such as sun.misc.Unsafe regardless of the "jdk.unsupported" module.

The Incubator Module is not included in the JRE. It is included in the JDK runtime, but cannot be used automatically by your application. To use it from an application, the java command requires the "--add-modules" option.

background

While OpenJDK is OSS, it also has the aspect of Java SE RI (reference implementation). The Java SE specifications are standardized by the JCP, but OpenJDK is free to add other functions. However, there is a risk that the functions in RI will become the de-fact standard, which will diminish the significance of standardization in the JCP. However, with that said, standardization by the JCP takes time, and it is also a problem that we cannot provide the latest technology in a timely manner.

It seems to be a measure to solve such a dilemma, but there is a debate as to whether it is really a solution.

Recommended Posts

JDK9 Incubator Module
[Java] Module
[Ruby] Module