ECJ batch compiler does not load multi-release module declaration when -target
is used
#2774
Labels
compiler
Eclipse Java Compiler (ecj) related issues
-target
is used
#2774
Version
ecj-3.38.0.jar
from Maven CentralDescription
When using the ECJ batch compiler and using
-target
respectively one of the shorthand variants such as-9
it does not load the module descriptor of a multi-release JAR (which contains the module descriptor for example asMETA-INF/versions/9/module-info.class
).It only loads the module descriptor when
--release
instead of-target
is used. And due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=577790 / #2778 the version for--release
must match exactly, but that is tracked in that issue.This differs from
javac
which seems to load the module descriptor when for example-target 9
is used.(This might affect not only the module descriptor but any class under the
versions
directory, but not sure if that matters since the JAR specification says those classes must have the same API as the classes in the top-level directory.)Reproduction steps
-target 10
(or alternatively-10
)--release 10
Now compare with
javac
behavior:-target 10
javac -target 9
META-INF/versions/10
)This proves that the
-target
option seems to determine whichversions
directories are checked in the JAR(Tested with JDK 17)
The text was updated successfully, but these errors were encountered: