By default, the "exploded JDK" tries to use a CDS archive. However, CDS is not supported in the exploded JDK, so it will always fail:
You can run the "exploded JDK" from your JDK build directory:
$ cd build/linux-x64-debug
$ ./jdk/bin/java -Xlog:cds -version
[0.002s][info][cds] The shared archive file cannot be used with an exploded module build.
[0.002s][info][cds] Unable to map shared spaces
java version "21-internal" 2023-09-19
Java(TM) SE Runtime Environment (build 21-internal-adhoc.iklam.nep)
JavaHotSpot(TM) 64-Bit Server VM (build 21-internal-adhoc.iklam.nep, mixed mode)
Proposal:
We should change aruments.cpp to unconditionally disable CDS when Arguments::has_jimage() is false, so the JVM won't even attempt to map the CDS archive.
You can run the "exploded JDK" from your JDK build directory:
$ cd build/linux-x64-debug
$ ./jdk/bin/java -Xlog:cds -version
[0.002s][info][cds] The shared archive file cannot be used with an exploded module build.
[0.002s][info][cds] Unable to map shared spaces
java version "21-internal" 2023-09-19
Java(TM) SE Runtime Environment (build 21-internal-adhoc.iklam.nep)
JavaHotSpot(TM) 64-Bit Server VM (build 21-internal-adhoc.iklam.nep, mixed mode)
Proposal:
We should change aruments.cpp to unconditionally disable CDS when Arguments::has_jimage() is false, so the JVM won't even attempt to map the CDS archive.