在IntelliJ中导入gradle项目 [英] Importing gradle project in IntelliJ

查看:851
本文介绍了在IntelliJ中导入gradle项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有IntelliJ 12.0和Gradle 1.2。在Windows 7上。当我尝试导入build.gradle文件时,我在IntelliJ中收到以下错误消息。我有点迷失在这里。关于如何解决这个问题的任何想法?

 (ThreadPoolExecutor.java:603)
在java.lang.Thread。运行(Thread.java:722)
导致:org.jetbrains.plugins.gradle.remote.GradleApiException:
无法使用Gradle安装'C:\程序文件获取'BasicIdeaProject'类型的模型(86)\gradle-1.2' 。
新创建的守护进程具有与预期不同的上下文。
不能重新连接到这个守护进程。上下文不匹配:
Java主页是不同的。
通缉: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]
实际:DefaultDaemonContext [uid = d8c5c4bc-5488-42c2-b4b3-28c1d53afacf,javaHome = C:\程序文件(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


项目结构 - >更改jdk路径没有jre。



我不确定它是如何到达那里的,但它让我永远追踪。也许是因为它从之前的糟糕安装中获取了设置。


I have IntelliJ 12.0 on and gradle 1.2. on Windows 7. When I try to import a build.gradle file I get the following error message in IntelliJ. I am a bit lost here. Any ideas on how to fix this?

 (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

解决方案

my fix: File -> Project Structure -> change the jdk path to not have jre.

I'm not sure how it got there, but it took me forever to track down. Perhaps because it picked up settings from a previous bad install.

这篇关于在IntelliJ中导入gradle项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆