[
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
|
What is possible to do is the following:
Run the compilation two times: one targeting JDK 11, which will compile the module-info, and other targeting JDK 8, will
override the classes built for JDK 11 with 8, and only the module-info will be there.
I guess using Moditect is also possible.
On Out 7 2021, at 2:38 pm, Scott Stark <starksm64@xxxxxxxxx> wrote:
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
![Sent from Mailspring]()
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.
_______________________________________________
jakartaee-platform-dev mailing list
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev