I am new to Android Studio.I installed Android Studio-1.2.1.1 and i have jdk1.7.0_40 installed.I am facing problem with gradle build. For reference you can check gradle issu
Solved this by going to File -> Project Structure -> SDK Location
and under JDK Location, update with Gradle SDK location.
EDIT: I fixed this issue by uninstalling all the jdk installation & updates then reinstall only one jdk and assure its env. variables
I do not have a solution but I have the same problem it happens as the android studio opens from java_home/jre thence all JVMs that will fork next will come from this path, while your system varible tells Gradle to get his java.exe from JAVA_HOME
I tried to make gradle read from jre but it falied also i tried to make android studio open from java_home/bin but it falid also
I solved it by going to Project Structure
then unchecking use embedded JDK
and then setting the path to C:\Program Files\Java\jdk1.8.0_121
This is a very late answer but I see that a common suggestion is to remove all other jdk's and this is not always the best idea. You might need older jdk's for different projects. You can go into the gradle.properties file for the project and enter the following line (varied based on your version):
org.gradle.java.home=C:/Java/jdk1.8.0_111
If you are using a different jdk just point to a different directory.