版权声明:本文为原创文章,转载请标明出处。 https://blog.csdn.net/u013467442/article/details/81487325
现象
idea打开gradle工程时出现如下的错误:
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 IDEA is using JDK and due to that two JAVA_HOME’s are different and giving errors.
与gradle版本没有关系
解决方法:
I am using Intellij 15.06, what solved my problem is just go to the directory, JAVA_HOME > jre > lib, and rename the tool.jar to tool.jar.bak, and then try to start a project or import a project again, at last, do not forget to rename it back to tool.jar.