Accepted
The SDK targets both server-side Java applications and Android applications. Android historically lagged the JVM ecosystem — Android API 21 (Lollipop) supports Java 8 language features with some limitations. The project must:
- Compile and run on Java 8+
- Be compatible with Android API 21+ (via the optional
com.google.android:androidstub) - Avoid Java 9+ APIs (modules,
var, new collection factories) in production code
Git history shows an explicit decision: "ignore jdk>8 due to android dependencies" and the pom.xml pin <java.version>1.8</java.version>.
- Set
<java.version>1.8</java.version>inpom.xmlfor both source and target compiler flags. - Include
com.google.android:androidas an optional compile-time dependency to provide Android API stubs without forcing Android as a required dependency for JVM-only consumers. - Pin
<android.platform>21</android.platform>as the minimum API level. - Keep all production Java code in
src/main/java/at Java 8 language level. Tests insrc/test/kotlin/may use Kotlin language features freely.
- Enables: SDK works on Android 5.0+ (API 21) and all Java 8+ server environments without modification.
- Constrains: Cannot use Java 9+ APIs (
var,List.of(),Map.of(),Optional.ifPresentOrElse(), etc.) in production code. New contributors accustomed to modern Java must be vigilant. - Testing: Robolectric is included in test scope for Android-specific test scenarios.
- CI: The devcontainer uses Temurin JDK 8 base image (multi-arch, supports Apple Silicon natively) to catch any accidental Java 9+ API usage.