[android] Enable Java 21

Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-08-25 21:15:09 +02:00
parent ca5cc46f2b
commit f9a1606f89
3 changed files with 10 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ on:
- main
env:
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
JAVA_HOME: /usr/lib/jvm/temurin-21-jdk-amd64 # Java 21 is required for Android Gradle 8 plugin
SKIP_MAP_DOWNLOAD: true
jobs:

View File

@@ -29,12 +29,12 @@ def getCommitMessage() {
project.ext.appId = 'app.comaps'
project.ext.appName = 'CoMaps'
// I have Java 21 installed, but this doesn't work on MacOS.
//java {
// toolchain {
// languageVersion.set(JavaLanguageVersion.of(17))
// }
//}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
android {
namespace = 'app.organicmaps'
@@ -311,8 +311,8 @@ android {
compileOptions {
coreLibraryDesugaringEnabled = true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}

View File

@@ -245,7 +245,7 @@ Check if you have a system-wide Java Runtime Environment (JRE) installed:
java -version
```
If your system doesn't have a JRE installed or Java version is less than 17 (OpenJDK)
If your system doesn't have a JRE installed or Java version is less than 21 (OpenJDK)
or you want command line builds to use a JRE version bundled with the Studio
then set the `JAVA_HOME` environment variable: