Trying to build j-extract on Linux throws "java.lang.module.FindException: Module jdk.compiler not found"

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Wed Sep 21 03:36:40 UTC 2022


Hi,

I just checked with Oracle jdk19 installation + jextract repo's master branch. Build/verify worked as expected on mac.

>From the error message you posted, it seems "jdk.compiler" module is missing in your jdk19 installation. jextract needs jdk.compiler module to compile the extracted Java sources to produce .class files.

Will you please check if the following command prints "jdk.compiler"?

/usr/lib/jvm/java-19-openjdk-19.0.0.0.36-2.rolling.fc38.x86_64/bin/java --list-modules | grep jdk.compiler

For example, in my case


$ /Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home/bin/java \

>   --list-modules | grep jdk.compiler

jdk.compiler at 19


If not, that installation may be missing compiler module (perhaps generated by jlink invocation). Solution is to install a full JDK 19.


Hope this helps,

-Sundar




________________________________
From: panama-dev <panama-dev-retn at openjdk.org> on behalf of Gavin Ray <ray.gavin97 at gmail.com>
Sent: 21 September 2022 07:35
To: panama-dev at openjdk.org <panama-dev at openjdk.org>
Subject: Trying to build j-extract on Linux throws "java.lang.module.FindException: Module jdk.compiler not found"

Hello all,

I'm trying to generate jextract types for io_uring (I didn't find any non-JNI/JNA libraries to use it from JVM)
Unfortunately, following the instructions I've hit a snag.

Building it with JDK 19, I get:
=============================================
[user at MSI jextract]$ sh ./gradlew \
-Pjdk19_home=/usr/lib/jvm/java-19-openjdk-19.0.0.0.36-2.rolling.fc38.x86_64 \
-Pllvm_home=/home/user/downloads/clang+llvm-15.0.0-aarch64-linux-gnu clean verify

> Task :compileJava
Note: Some input files use preview features of Java SE 19.
Note: Recompile with -Xlint:preview for details.

> Task :createJextractImage FAILED
Error: Module jdk.compiler not found
java.lang.module.FindException: Module jdk.compiler not found
        at java.base/java.lang.module.Resolver.findFail(Resolver.java:892)
        at java.base/java.lang.module.Resolver.resolve(Resolver.java:129)
        at java.base/java.lang.module.Configuration.resolve(Configuration.java:420)
        at java.base/java.lang.module.Configuration.resolve(Configuration.java:254)
        at jdk.jlink/jdk.tools.jlink.internal.Jlink$JlinkConfiguration.resolve(Jlink.java:217)
        at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImageProvider(JlinkTask.java:536)
        at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImage(JlinkTask.java:424)
        at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:276)
        at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:56)
        at jdk.jlink/jdk.tools.jlink.internal.Main.main(Main.java:34)
=============================================

Would it make sense to add a Dockerfile for Linux to the repo that can reliably build the latest version?
That way folks don't have to mess around with finding and installing LLVM and whatnot.

I'm happy to submit a PR for this if someone can tell me why the regular build command is failing, ha.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20220921/43dc7a9e/attachment-0001.htm>


More information about the panama-dev mailing list