在IntelliJ中导入gradle项目

nil*_*ock 7 intellij-idea gradle

我有IntelliJ 12.0和gradle 1.2.在Windows 7上.当我尝试导入build.gradle文件时,我在IntelliJ中收到以下错误消息.我在这里有点迷失.有想法该怎么解决这个吗?

 (ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
 Caused by: org.jetbrains.plugins.gradle.remote.GradleApiException: 
 Could not fetch model of type 'BasicIdeaProject' using Gradle installation 'C:\Program Files (x86)\gradle-1.2'.
 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=c:\program files (x86)\jetbrains     \intellij idea 12.0\jre\jre,daemonRegistryDir=C:\Users\Nilo\.gradle     \daemon,pid=5144,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:     +HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
 Actual: DefaultDaemonContext[uid=d8c5c4bc-5488-42c2-b4b3-28c1d53afacf,javaHome=C:     \Program Files (x86)\JetBrains\IntelliJ IDEA 12.0\jre,daemonRegistryDir=C:\Users\Nilo \.gradle\daemon,pid=6880,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
at org.jetbrains.plugins.gradle.remote.impl.GradleProjectResolverImpl.resolveProjectInfo(GradleProjectResolverImpl.java:61)
... 21 more
Run Code Online (Sandbox Code Playgroud)

Cha*_*ani 3

我的修复:文件 -> 项目结构 -> 将 jdk 路径更改为没有 jre。

我不知道它是怎么到那里的,但我花了很长时间才找到它。也许是因为它从以前的错误安装中获取了设置。