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 issue
I am getting following error in messages
Error:The newly created daemon process has a different context than expected.
Java home is different.
Expecting: 'C:\Program Files\Java\jdk1.7.0_40' but was: 'C:\Program Files\Java\jdk1.7.0_40\jre'.
Please configure the JDK to match the expected one.
<a href="open.project.structure">Open JDK Settings</a>
All i understood is gradle is using JRE and Android Studio is using JDK and due to that two JAVA_HOME's are different and giving errors.
I tried downloading gradle 2.3 and changed gradle path in android studio to this file,still same problem.
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.
Replace this
C:\Program Files\Java\jdk1.7.0_40\jre
with
C:\Program Files\Java\jdk1.7.0_40
inside your JAVA_HOME
variable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With