Adam Saghy created FINERACT-2842:
------------------------------------
Summary: Move away from JDK8 in avro and fineract-client
Key: FINERACT-2842
URL: https://issues.apache.org/jira/browse/FINERACT-2842
Project: Apache Fineract
Issue Type: Improvement
Affects Versions: 1.15.0
Reporter: Adam Saghy
Assignee: Adam Saghy
Fix For: 1.16.0
For legacy reasons in 2020 it was decided `fineract-client` should remain and
generate JDK8 artifacts, but that one is not needed anymore.
h3. Why drop Java 8 rather than work around it
The pin dates to 0897f172ee (Oct 2020), citing FINERACT-1214 — which is
actually a bug about the Swagger client returning RxJava {{{}Observable{}}}s.
Android appears there only in a wish-list of SDK variants that was never built.
Three things make the baseline obsolete:
* *For {{fineract-avro-schemas}} it was already broken.* Avro 1.12.1 is Java
11 bytecode (major 55) and every generated class extends
{{{}SpecificRecordBase{}}}, so a Java 8 JVM would fail with
{{{}UnsupportedClassVersionError{}}}. Gradle never caught this because Avro
publishes POM-only metadata, carrying no {{org.gradle.jvm.version}} attribute.
* *Android no longer needs Java 8 bytecode.* Android 14 ships OpenJDK 17 core
libraries, and D8 desugars for lower {{{}minSdk{}}}.
* *Nothing is being consumed.* No artifacts exist under
{{org.apache.fineract}} on Maven Central; the only publish anywhere is one ASF
snapshot, {{{}fineract-client 1.6.1-…-SNAPSHOT{}}}, dated May 2022.
h3. Changes
||Module||Before||After||
|{{fineract-client}}|Java 8 (major 52)|*Java 17* (major 61)|
|{{fineract-avro-schemas}}|Java 8 (major 52)|*toolchain, Java 25* (major 69)|
{{fineract-client}} is set to 17 rather than the toolchain's 25 deliberately:
Android 14 provides Java 17 core libraries and AGP still requires/targets JDK
17, so Java 21+ bytecode is not consumable by D8/R8. Letting it inherit the
toolchain would emit major 69 and silently break Android consumers.
{{fineract-avro-schemas}} has no such story — it is consumed only by
server-side modules, all on toolchain 25.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)