gradle require java version

Java
// build.gradle
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
Source

Also in Java: