From d741967b5b730d69c640862a2921925355d2838e Mon Sep 17 00:00:00 2001 From: Patryk Mis Date: Tue, 2 May 2023 12:22:49 +0200 Subject: [PATCH] Set Java version with Gradle toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Java version should be consistent for all tasks "It has been possible to configure Gradle to build a project with a different Java version than the one used to run Gradle. However, it has required configuring each task like compilation, test, and javadoc separately. Gradle 6.7 introduces “Java toolchain support”. In a nutshell, it allows you to run Gradle with whatever version of Java you have installed, while Gradle builds the project with the version of Java declared in a single place. Gradle will automatically configure the build, detect already installed JDKs and download the required JDK if it is not already installed." More at https://blog.gradle.org/java-toolchains Signed-off-by: Patryk Mis --- app/build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 3959a7808..3261aeb8e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,6 +39,12 @@ project.ext { ] } +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(11)) + } +} + android { namespace 'com.aurora.store' compileSdk 33