[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jakartaee-platform-dev] The location of module-info.java and muti release jar
|
How can you produce a jar that can be read by Java SE 8 unless it is multi-release? The comment there is talking about compiling under SE 11 which cannot be read at all by SE 8. The most basic class file compiled under 11 blows up when using 8:
└> /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/bin/java Hello
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: Hello has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Since we are on the topic of module-info, I observed different specifications doing different things as far as the location goes. Also, some spec produces multi-release jar such as Injection spec (see
here).
I was told some other specs just place module-info.class under root and do not produce a multi release jar as module-info.class will be ignored by Java 8 (the api jar compiled at Java 8). This is a cleaner way to do it.
Can we define a convention for this? I know EJB is trying to add module-info as well and a long conversation is happening(see
this PR). We really need to sort it out on the platform level.