diff --git a/build.gradle b/build.gradle index fd41d6d290b9..1c71d9f5c143 100644 --- a/build.gradle +++ b/build.gradle @@ -40,8 +40,8 @@ plugins { id 'com.palantir.consistent-versions' version '1.9.2' } -if (JavaVersion.current() != JavaVersion.VERSION_1_8) { - throw new GradleException("This build must be run with Java 8") +if (!JavaVersion.current().java8Compatible) { + throw new GradleException("This build must be run with Java 8 or above version") } allprojects {