Skip to content

Commit ac4ff2a

Browse files
committed
Use Java toolchain support to compile with JDK8
1 parent e1d2ade commit ac4ff2a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ dependencies {
4444
testRuntime 'org.objenesis:objenesis:3.1'
4545
}
4646

47-
sourceCompatibility = "1.8"
48-
targetCompatibility = "1.8"
47+
java {
48+
toolchain {
49+
languageVersion = JavaLanguageVersion.of(8)
50+
}
51+
}
4952

5053
def generatedResources = "$buildDir/generated-resources/main"
5154

@@ -103,8 +106,4 @@ tasks.withType(Test).configureEach {
103106
maxRetries = 3
104107
maxFailures = 20
105108
}
106-
}
107-
108-
if (!JavaVersion.current().java8) {
109-
throw new RuntimeException("Java 8 is required to execute the build")
110-
}
109+
}

0 commit comments

Comments
 (0)