简体   繁体   中英

Getting a NPE on Java 11 jdeps tool when scanning Spring Boot .jar files

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?

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 :(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM