You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Libraries which want to target Java 8 (respectively Android) as lowest version, but also want to provide a module descriptor commonly use multi-release JARs for this, e.g. META-INF/versions/9/module-info.class. This is also explicitly mentioned in the JAR specification:
A module descriptor may be present under a versioned area but not present under the top-level directory.
The problem is that the ECJ batch compiler when used with --release N only considers META-INF/versions/N, but not any directories < N of libraries in the module path.
This differs from javac behavior, from Java runtime behavior (as required by the JAR specification) and also from Eclipse JDT behavior within the IDE (that has a different problem though, see #2495).
This report here is only about --release; currently the ECJ batch compiler does not read multi-release classes at all when using -target, see #2774.
There was a pull request for this, but it has been abandoned: #61
Marcono1234
changed the title
ECJ batch compiler fails to recognize multi-release module on module-path
ECJ batch compiler only loads multi-release classes with exact --release match
Jul 30, 2024
This is a clone of https://bugs.eclipse.org/bugs/show_bug.cgi?id=577790, as suggested in #2773 (comment)
Version
ecj-3.38.0.jar
from Maven Central(and earlier versions, see Bugzilla report)
Description
Libraries which want to target Java 8 (respectively Android) as lowest version, but also want to provide a module descriptor commonly use multi-release JARs for this, e.g.
META-INF/versions/9/module-info.class
. This is also explicitly mentioned in the JAR specification:The problem is that the ECJ batch compiler when used with
--release N
only considersMETA-INF/versions/N
, but not any directories < N of libraries in the module path.This differs from
javac
behavior, from Java runtime behavior (as required by the JAR specification) and also from Eclipse JDT behavior within the IDE (that has a different problem though, see #2495).This report here is only about
--release
; currently the ECJ batch compiler does not read multi-release classes at all when using-target
, see #2774.There was a pull request for this, but it has been abandoned: #61
Reproduction steps
--release 11
--release 10
(which matches exactly theMETA-INF/versions/10
in the JAR)The text was updated successfully, but these errors were encountered: