invalid source release: 1.8 while Gradle build
<p>I have the following line in my <code>build.gradle</code></p>

<pre><code>sourceCompatibility = 1.8
</code></pre>

<p>And when I compile it, the following error occurs:</p>

<pre><code>FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
&gt; invalid source release: 1.8
</code></pre>

<p>Setting JAVA_HOME to short filename didn't help.</p>

<p>How to build with Gradle under Java 8 under Windows?</p>

<p><strong>UPDATE</strong></p>

<pre><code>C:\&gt;echo %JAVA_HOME%
C:\PROGRA~1\Java\jdk1.8.0_91

C:\&gt;dir %JAVA_HOME%
COPYRIGHT  README.html                         THIRDPARTYLICENSEREADME.txt  db       javafx-src.zip  lib      src.zip
LICENSE    THIRDPARTYLICENSEREADME-JAVAFX.txt  bin                          include  jre             release
</code></pre>