See
https://github.com/openjdk/jdk/blob/918cf114548d0098cf6a8a50032b78ee04d453db/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java#L248
With this patch:
diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
index b97b0a2de40..55dccf03c1c 100644
--- a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
+++ b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
@@ -246,6 +246,9 @@ private static ModuleLayer boot2() {
hasSplitPackages = systemModules.hasSplitPackages();
hasIncubatorModules = systemModules.hasIncubatorModules();
+ if (System.getProperty("debug") != null) {
+ System.out.println("hasIncubatorModules = " + hasIncubatorModules);
+ }
// not using the archived module graph - avoid accidental use
archivedModuleGraph = null;
}
$ java -Xshare:off -Ddebug=1 --version
hasIncubatorModules = false
[...]
$ rm -rf empty
$ mkdir empty
$ tava -Xshare:off -Ddebug=1 -p empty --version
hasIncubatorModules = true
[...]