Skip to content

Commit 5a13516

Browse files
committed
Add Java toolchain
1 parent 24526b6 commit 5a13516

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

build.gradle

+4-7
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ plugins {
1111
id "biz.aQute.bnd.builder" version "6.4.0"
1212
}
1313

14-
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
15-
def msg = String.format("This build must be run with java 1.8 - you are running %s - gradle finds the JDK via JAVA_HOME=%s",
16-
JavaVersion.current(), System.getenv("JAVA_HOME"))
17-
throw new GradleException(msg)
14+
java {
15+
toolchain {
16+
languageVersion = JavaLanguageVersion.of(11)
17+
}
1818
}
1919

20-
sourceCompatibility = 1.8
21-
targetCompatibility = 1.8
22-
2320
def getDevelopmentVersion() {
2421
def output = new StringBuilder()
2522
def error = new StringBuilder()

0 commit comments

Comments
 (0)