[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 - main
env: 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 SKIP_MAP_DOWNLOAD: true
jobs: jobs:

View File

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

View File

@@ -245,7 +245,7 @@ Check if you have a system-wide Java Runtime Environment (JRE) installed:
java -version 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 or you want command line builds to use a JRE version bundled with the Studio
then set the `JAVA_HOME` environment variable: then set the `JAVA_HOME` environment variable: