chore: avoid Java version mismatch (alternative mix of Java 8 & Java 11)#446
chore: avoid Java version mismatch (alternative mix of Java 8 & Java 11)#446nielspardon wants to merge 1 commit into
Conversation
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
|
This change uses within the same task both of these options: The Java 17 javac spec says:
Mixing these options (along with |
See my comment here: #443 (comment) This alternative tries to create a more deterministic build behavior. Specifically in configuring the Gradle toolchain plugin to select the same JDK consistently and not randomly selecting a different JDK version without changing large amounts of Java code. As I stated above this does not solve all issues with the Jabel approach. |
Another alternative to #433 which requires less changes.
Mainly:
Downside of the approach is that we are still relying on Jabel to enable a subset of the newer Java syntax to be compiled by the Java compiler to Java 8 compatible bytecode while especially for Java API changes we may still need to write code that only uses the APIs available in Java 8 or Java 11 depending on the module.