Android env: require JDK 21/17 by version, since Studio now bundles JBR 25

Check each JDK candidate's major version instead of assuming Android Studio's
JBR is 21, look for Adoptium temurin-{21,17}-jdk (Fedora 44 dropped
java-21-openjdk), and propagate android-env.sh failures to scripts that
source it so fdroid-publish.sh stops before building.
This commit is contained in:
2026-10-16 22:08:47 -05:00
parent 8301371679
commit 89378a41fb
3 changed files with 39 additions and 24 deletions

View File

@@ -474,9 +474,10 @@ prints the three environment variables to export (`ANDROID_HOME`, `NDK_HOME`,
> Android's system libsqlite3 either — the card schema needs FTS5 with the
> `trigram` tokenizer, which platform SQLite often lacks.
> **Why `JAVA_HOME`?** Gradle/AGP reject very new JDKs. The script prefers
> Android Studio's bundled JetBrains Runtime (JDK 21), which needs no extra
> install.
> **Why `JAVA_HOME`?** Gradle/AGP reject very new JDKs. The script uses
> Android Studio's bundled JetBrains Runtime when it's JDK 21 or 17, but recent
> Studio releases bundle JDK 25 and Fedora 44 no longer packages 21, so you may
> need `sudo dnf install temurin-21-jdk` (from the Adoptium repo).
### Build and run