Neither the Groovy compiler nor Gradle itself can currently be run with Java 8 because some of their underlying libraries (notably ASM) don’t support Java 8 yet. If you want to compile against Java 8, you can set ‘compileJava.options.fork = true; compileJava.options.forkOptions.executable = “path/to/javac”’, or ‘compileGroovy.groovyCompileOptions.fork = true; compileGroovy.options.forkOptions.executable = “path/to/javac”’ in case of Java/Groovy joint compilation.