IntelliJ IDEA“所选目录不是JDK的有效主页”

IntelliJ IDEA“所选目录不是JDK的有效主页”

问题描述:

我刚刚安装了IntelliJ IDEA,我正在尝试设置它。我已经到了需要为我的JDK选择主目录的部分。

I just installed IntelliJ IDEA and I'm trying to set it up. I've gotten to the part where I need to select my home directory for my JDK.

我尝试导航到我的Java安装, C: \Program Files(x86)\ Java ,点击没关系,但它告诉我上面的消息。所以,我尝试了 C:\Program Files(x86)\ Java @ \\ _jre7 ,但这也无效。

I tried navigating to my Java installation, C:\Program Files (x86)\Java, and clicked okay but it told me the message above. So, I tried C:\Program Files (x86)\Java\jre7 and that didn't work either.

我尝试重新安装最新的JDK(来自这里)我仍然无法选择我的JDK。我甚至拖了我从网站上获得的 .jar 安装程序,文件选择器窗口无法识别它。

I tried reinstalling the latest JDK (from here) and I still couldn't choose my JDK. I even dragged the .jar installer I got from the website and the file selector window wouldn't recognize it.

我处于停滞状态,我不知道该怎么办。

I'm at a standstill and I don't know what to do.

因为你选择的是 jre dir。而不是 JDK 目录。 JDK dir。例如(取决于更新以及它是64位还是32位): C:\Program Files(x86)\ Java \ _ddk1.7.0_45
在我的情况下,它是32位 JDK 1.7 更新45

Because you are choosing jre dir. and not JDK dir. JDK dir. is for instance (depending on update and whether it's 64 bit or 32 bit): C:\Program Files (x86)\Java\jdk1.7.0_45 In my case it's 32 bit JDK 1.7 update 45