编程语言
首页 > 编程语言> > java – jdeps命令与`–multi-release`选项一起使用失败

java – jdeps命令与`–multi-release`选项一起使用失败

作者:互联网

我运行了以下命令,但我得到了同样的错误:

$jdeps --generate-module-info . --multi-release 9 libs/log4j-core-2.11.1.jar
Error: log4j-core-2.11.1.jar is a multi-release jar file but --multi-release option is not set

$jdeps --generate-module-info . --multi-release 10 libs/log4j-core-2.11.1.jar
Error: log4j-core-2.11.1.jar is a multi-release jar file but --multi-release option is not set

$jdeps --generate-module-info . --multi-release 11 libs/log4j-core-2.11.1.jar
Error: log4j-core-2.11.1.jar is a multi-release jar file but --multi-release option is not set

$jdeps --generate-module-info . libs/log4j-core-2.11.1.jar
Error: log4j-core-2.11.1.jar is a multi-release jar file but --multi-release option is not set

上述命令有什么问题?

关注我的环境的其他命令:

$java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

$javac --version
javac 10.0.2

$jdeps --version
10.0.2

与java-11-oracle相同的错误.

解决方法:

有一个带有–multi-release选项的bug可用于模块

jdeps fails when executing on a non multi release jar and the –class-path contains multi release jars.
The opposite is also true.
jdeps fails when executing on a multi release jar with the appropriate –multi-release flag is set and the –class-path contains non multi release jars.

总结了这个问题:

This basically makes multi-release jars unusable with modules.

标签:java,log4j,java-9,java-11,jdeps
来源: https://codeday.me/bug/20190607/1193919.html