Issue
When I'm trying to find the Java modules that I need to link in my custom JRE, I do get an NPE from jdeps
tool:
marc$ jdeps --module-path $JAVA_HOME/jmods --print-module-deps --multi-release 11 target/blha/jx1-0.0.1-SNAPSHOT/BOOT-INF/lib/*.jar
Exception in thread "main" java.lang.NullPointerException
at jdk.jdeps/com.sun.tools.jdeps.ModuleGraphBuilder.requiresTransitive(ModuleGraphBuilder.java:124)
at jdk.jdeps/com.sun.tools.jdeps.ModuleGraphBuilder.buildGraph(ModuleGraphBuilder.java:110)
at jdk.jdeps/com.sun.tools.jdeps.ModuleGraphBuilder.reduced(ModuleGraphBuilder.java:65)
at jdk.jdeps/com.sun.tools.jdeps.ModuleExportsAnalyzer.modules(ModuleExportsAnalyzer.java:124)
at jdk.jdeps/com.sun.tools.jdeps.ModuleExportsAnalyzer.run(ModuleExportsAnalyzer.java:97)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask$ListModuleDeps.run(JdepsTask.java:1023)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:560)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:519)
at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)
Any idea how to find all modules that I need to link to the custom JRE for this Spring Boot project?
Solution
You are most likely affected by [JDK-8211887] jdeps throws NPE when analyzing javafx.media that references a non-existent class used to be in JDK, you have the same stack trace with the NPE at ModuleGraphBuilder.java:124
.
This issue is resolved in Java 12 and suggested workaround for Java 11 is to use --ignore-missing-deps
option. I'm not seeing a backport to Java 11 :(
Answered By - Karol Dowbecki
Answer Checked By - Candace Johnson (JavaFixing Volunteer)