Skip to content

Commit 6928e80

Browse files
committed
show comprehensible error message if not building with java 8
analogous to mbeddr.core#1976
1 parent 994c0e5 commit 6928e80

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ if (project.hasProperty("forceCI")) {
3939
}
4040
}
4141

42+
// comprehensible error message if not running java 8
43+
if(JavaVersion.current() != JavaVersion.VERSION_1_8){
44+
throw new GradleException("This build script requires java " + JavaVersion.VERSION_1_8 + ", but you are currently using " + JavaVersion.current())
45+
}
4246
// Detect jdk location, required to start ant with tools.jar on classpath otherwise javac and tests will fail
4347
def java_home = System.properties['java.home']
4448
def jdk_home = java_home

0 commit comments

Comments
 (0)