From f8b40c37baaf12d7f2f061c0260aacf3d6ea7103 Mon Sep 17 00:00:00 2001 From: Simon Marquis Date: Sat, 19 Oct 2024 10:41:19 +0100 Subject: [PATCH] Check Java version compatibility And abort current build with a message containing current Java version and a link to the official docs on how to setup the correct Java version. Fixes #910 --- settings.gradle.kts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index c90c1a24a..465a72616 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -63,3 +63,11 @@ include(":lint") include(":sync:work") include(":sync:sync-test") include(":ui-test-hilt-manifest") + +check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { + """ + Now in Android requires JDK 17+ but it is currently using JDK ${JavaVersion.current()}. + Java Home: [${System.getProperty("java.home")}] + https://developer.android.com/build/jdks#jdk-config-in-studio + """.trimIndent() +}