码迷,mamicode.com
首页 > 编程语言 > 详细

Gradle工程错误:Gradle sync failed: Java home is different

时间:2017-04-17 15:05:22      阅读:3546      评论:0      收藏:0      [点我收藏+]

标签:gradle 异常

 Gradle sync failed: Java home is different

(1)错误描述

Gradle sync failed: The newly created daemon process has a different context than expected.

It won‘t be possible to reconnect to this daemon. Context mismatch: 

Java home is different.

Wanted: DefaultDaemonContext[uid=null,javaHome=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3\jre,daemonRegistryDir=C:\Users\SAMSUNG\.gradle\daemon,pid=14504,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]

Actual: DefaultDaemonContext[uid=e3f7107e-b6b3-4f6b-a3ae-a4bbaa04305c,javaHome=D:\Java\jdk1.8.0_121,daemonRegistryDir=C:\SAMSUNG\lihy\.gradle\daemon,pid=18556,idleTimeout=60000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]

Consult IDE log for more details (Help | Show Log)

(2)解决方法:

在gradle.properties文件中加入org.gradle.Java.home=E\:\\Software\\Android\\Java\\jdk1.8.0_92


Gradle工程错误:Gradle sync failed: Java home is different

标签:gradle 异常

原文地址:http://idzhaoxiao.blog.51cto.com/9661978/1916512

(2)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!