title: Gradle wrapper get wrong Java version in Android project on Windows
body: <p>I am using gradle within an Android project on Windows.</p>
  
  <p>When I execute <code>./gradlew -version</code> within my project path, error is shown as <code>Could not determine java version from '12'.</code></p>
  
  <p>I did have <strong>both Java 8 and 12 installed</strong> on my machine but my <code>JAVA_HOME</code> variable is set to jdk1.8 path, the JDK location in Android Studio is also set to jdk1.8. as show below. If I call <code>java -version</code> from cmd I could also get version 1.8 instead of version 12.</p>
  
  <p><a href="https://i.stack.imgur.com/ZxOX8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZxOX8.png" alt="JDK location setup in Android Studio"></a></p>
  
  <p>So why does gradle get a wrong version of Java? Is there any other configuration that might lead to this result?</p>
  
  <p>Gradle version is 4.1 but I prefer not to update it.</p>