$ echo 'public class Foo { public static void main(String ... args) { } }' >Foo.java
$ java --add-modules jdk.incubator.vector Foo.java
WARNING: Using incubator modules: jdk.incubator.vector
warning: using incubating module(s): jdk.incubator.vector
1 warning
$ java --add-modules jdk.incubator.vector,jdk.incubator.concurrent Foo.java
WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.concurrent
warning: using incubating module(s): jdk.incubator.concurrent,jdk.incubator.vector
1 warning
$ java --version
openjdk 19-ea 2022-09-20
OpenJDK Runtime Environment (build 19-ea+31-2203)
OpenJDK 64-Bit Server VM (build 19-ea+31-2203, mixed mode, sharing)
$
(1) JEP 11 defines incubator modules, not incubating modules.
(2) Warning that incubator modules are in use when only one incubator module is in use is incorrect.
(“WARNING” vs. “warning” is due to the fact that the former is emitted by the runtime while the latter is emitted by the compiler. Ideally we’d coalesce the two messages into one when launching a single-file source-code program; see
- relates to
-
JDK-8290561 Coalesce incubator-module warnings for single-file source-code programs
-
- Resolved
-