-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe GraalVM and your environment :
- GraalVM version or commit id if built from source: 21.0.2+13.1
- CE or EE: CE
- JDK version: JDK21.0.2
- OS and OS Version: Ubuntu
- Architecture: amd64
- The output of
java -Xinternalversion
:
OpenJDK 64-Bit Server VM (21.0.2+13-jvmci-23.1-b30) for linux-amd64 JRE (21.0.2+13-jvmci-23.1-b30),
built on 2024-01-06T13:12:14Z by "buildslave" with gcc 11.2.0
Have you verified this issue still happens when using the latest snapshot?
Confirmed by a discussion on slack
Describe the issue
I am trying to find a minimal JDK to execute Enso programming language and environment on, I am using jlink
. I am trying to get things down as much as I can, but Graal.js seems to need java.desktop
! (via a transitive dependency thru regex
):
java.lang.module.FindException: Module java.desktop not found, required by org.graalvm.shadowed.icu4j
$ rm ./built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/component/icu4j-24.0.0.jar
java.lang.module.FindException: Module org.graalvm.shadowed.icu4j not found, required by com.oracle.truffle.regex
$ rm ./built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/component/regex-24.0.0.jar
java.lang.module.FindException: Module com.oracle.truffle.regex not found, required by org.graalvm.js
E.g. org.graalvm.js
needs com.oracle.truffle.regex
and that one needs org.graalvm.shadowed.icu4j
and that one needs java.desktop
.
I assume the java.desktop
dependency isn't necessary - maybe it can be made optional... can such a change be made in your build?
Steps to reproduce the issue
I am generating the minimal JDK as:
$ /graalvm/bin/jlink --output jdk --add-modules java.net.http,jdk.unsupported,java.sql,jdk.management,jdk.jfr
$ ./jdk/bin/java --list-modules
java.base@21.0.2
java.logging@21.0.2
java.management@21.0.2
java.net.http@21.0.2
java.sql@21.0.2
java.transaction.xa@21.0.2
java.xml@21.0.2
jdk.internal.vm.ci@21.0.2
jdk.jfr@21.0.2
jdk.management@21.0.2
jdk.unsupported@21.0.2
and then I'd like to invoke Graal.js and its components on the generated JVM. It fails with java.lang.module.FindException
as shown above.
Expected behavior
java.desktop
is a huge module and it shouldn't be needed for running Graal.js - having that fixed would allow using Graal.js & co. in headless JDKs without java.desktop
& co. modules.
Additional context
I have discovered this problem while working on: