如何在MacOs下设置Idea

时间:2017-12-27 12:35:49

标签: java macos intellij-idea

我为Mac OS下载了Idea EAP 2017.3 Ultimate,带有捆绑的jre。

一旦克隆了我的gradle项目,我尝试同步,但它抱怨没有项目SDK。

我尝试在/Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home下添加捆绑的jre,但它总是抱怨它不是一个有效的JDK家。

所以我下载了jre 9并安装了。

添加了作为Project SDK,现在我得到了这个:

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=/Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home,daemonRegistryDir=/Users/loredanasoetta/.gradle/daemon,pid=421,idleTimeout=null,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=IT,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=d56a6606-9df7-4dbb-b269-96531b5ba6f9,javaHome=/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home,daemonRegistryDir=/Users/loredanasoetta/.gradle/daemon,pid=481,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=IT,-Duser.language=en,-Duser.variant]

1)为什么捆绑的jre不被接受?

2)我通过明确声明gradle-wrapper.properties

中的jdk路径看到有些人解决了

org.gradle.java.home=/Library...

但是这是垃圾,因为它会被推到回购站上而且只对我有效

在Mac OS上使用Idea的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

Serge Baranov的信用

  1. 不是完整JDK的bundle运行时,您需要安装正常的JDK才能进行开发,请参阅this

  2. 配置用于在IntelliJ IDEA中运行Gradle的JDK:

  3. enter image description here