Issue
I ran the followings commands, but I got the same errors:
$ 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
What's the problem with the above commands?
Follow others commands about my environment:
$ 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
Same error with the java-11-oracle
.
Solution
There's a bug with --multi-release option to work with modules
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.
Which summarizes the issue:
This basically makes multi-release jars unusable with modules.
Answered By - user7294900
Answer Checked By - Marilyn (JavaFixing Volunteer)