From 2d728715798c14302c1c8279e1bf6f229955d920 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sun, 14 May 2023 16:47:22 +0300 Subject: Simplify source/target compatibility setting The build has to use Java 17 because of the Loom version. --- build.gradle | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 3c6c313..e6d9f0e 100644 --- a/build.gradle +++ b/build.gradle @@ -106,22 +106,9 @@ processResources { java { withSourcesJar() withJavadocJar() -} -allprojects { - plugins.withId('java') { // when the java plugin is applied in the project - java { - // Use Java 17 toolchain if running on older version of Java, but allow newer versions - if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } - } else { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - } - } + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } tasks.withType(JavaCompile) { -- cgit