0

I have the following line in my build.gradle

sourceCompatibility = 1.8

And when I compile it, the following error occurs:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> invalid source release: 1.8

Setting JAVA_HOME to short filename didn't help.

How to build with Gradle under Java 8 under Windows?

UPDATE

C:\>echo %JAVA_HOME%
C:\PROGRA~1\Java\jdk1.8.0_91

C:\>dir %JAVA_HOME%
COPYRIGHT  README.html                         THIRDPARTYLICENSEREADME.txt  db       javafx-src.zip  lib      src.zip
LICENSE    THIRDPARTYLICENSEREADME-JAVAFX.txt  bin                          include  jre             release
Dims
  • 47,675
  • 117
  • 331
  • 600
  • 1
    It occurs under console or when you work with IDE? – Opal Jun 17 '16 at 13:30
  • Can you share the content of your `JAVA_HOME`? – Mureinik Jun 17 '16 at 13:30
  • 1
    Can you try the answers here? http://stackoverflow.com/questions/17841589/gradle-build-with-java-8 – Tunaki Jun 17 '16 at 13:30
  • @Opal you are right, it appear under IDE only; I was thinking running goal from under IDE is equivalent to run goal from command line. – Dims Jun 17 '16 at 14:02
  • This might be helpful: http://stackoverflow.com/questions/25878045/errorjava-invalid-source-release-8-in-intellij-what-does-it-mean – Opal Jun 17 '16 at 14:06

0 Answers0