fix: force JAVA_HOME to ~/jdk21 when system Java ≥ 25

Gradle 8.x supports up to Java 24. Fedora 44 ships Java 25 by default,
causing "Unsupported class file major version 69" at build time.

build-apk.sh now auto-detects system Java version and falls back to
~/jdk21 (Temurin 21 LTS) when Java ≥ 25 is detected.
README documents the one-time JDK 21 install step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 20:52:54 +02:00
parent e051ce8e7f
commit aaf6b2aa07
2 changed files with 29 additions and 4 deletions
+14 -2
View File
@@ -26,7 +26,7 @@ Build is fully local — no expo.dev account or EAS cloud required.
|------|---------|
| Node.js | 20 LTS |
| pnpm | 10+ |
| Java (JDK) | 17+ |
| Java (JDK) | 1724 (Java 25+ not yet supported by Gradle 8) |
| Android SDK | see below |
No expo.dev account needed for builds.
@@ -57,7 +57,19 @@ Scan the QR code with Expo Go on Android to preview the app live.
### First-time setup
**1. Android SDK**
**1. Java 21 LTS**
Gradle 8 requires Java ≤ 24. If the system Java is 25+ (Fedora 44), install Temurin 21 locally:
```bash
wget -O /tmp/jdk21.tar.gz \
"https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.7%2B6/OpenJDK21U-jdk_x64_linux_hotspot_21.0.7_6.tar.gz"
mkdir -p ~/jdk21 && tar -xzf /tmp/jdk21.tar.gz -C ~/jdk21 --strip-components=1
```
`build-apk.sh` will use `~/jdk21` automatically if the system Java is ≥ 25.
**2. Android SDK**
```bash
cd artifacts/postiz-mobile