Please.
i just did a test and it seems that i was wrong with this one. i dropped module-info support from java-pkg-simple.eclass, and forced source on stax2-api to 9 using JAVA_PKG_WANT_SOURCE="9". the goal was to compile the code using jdk 9+ source but build jdk 1.8 bytecode. but this is the result on the modified stax2-api: javac -source 9 -target 1.8 -d target/classes -encoding UTF-8 --module-version 4.2.1 @sources.lst warning: source release 9 requires target release 9 and then ejavac crashes. so the only change to java-pkg-simple.eclass will be probably just changing ewarn "Need at least JDK 9 to compile module-info.java in src_compile," to die as Flow suggested. still, this would be good to do to catch any packages that would not be fixed by accident.
As far as I remember, the way to do it was to compile everything for Java 1.8 (source/target/bootstrap; the last one is important too, since otherwise you get 1.8 class files which can still depend on the 9+ standard library) except the module-info.java, which is then compiled with source/target/bootstrap of Java 9. At runtime Java 1.8 would then complain about the class file version of the module-info.class, but it has no meaning for it anyway.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a890940dce62dea54a867901f85e37985bc76943 commit a890940dce62dea54a867901f85e37985bc76943 Author: Florian Schmaus <flow@gentoo.org> AuthorDate: 2022-05-03 20:19:05 +0000 Commit: Florian Schmaus <flow@gentoo.org> CommitDate: 2022-05-05 09:30:28 +0000 java-pkg-simple.eclass: eqawarn if module-info.java is not compiled In preperation of this ewarn part becoming 'die' (bug #842447), switch it to eqawarn to improve catching the affected packages. Bug: https://bugs.gentoo.org/796875 Bug: https://bugs.gentoo.org/842447 Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/25306 eclass/java-pkg-simple.eclass | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Fixed withccommit a890940dce62dea54a867901f85e37985bc76943