所选目录不是JDK的有效主页 - Ubuntu上的Intellij IDEA [英] Selected directory is not a valid home for JDK - Intellij IDEA on Ubuntu

查看:821
本文介绍了所选目录不是JDK的有效主页 - Ubuntu上的Intellij IDEA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的14.04 Ubuntu系统上安装了Intellij Idea 14和OracleJDK 1.8 u25(64位)之后,我无法将Java SDK配置为使用任何JDK。当我导航到模块设置 - > SDK并单击配置SDK,添加按钮,然后在对话框中选择 /usr/java/jdk1.8.0_25 ,我得到一个错误弹出窗口,指出所选目录不是JDK的有效主页。

After installing Intellij Idea 14, with OracleJDK 1.8 u25 (64 bit) on my 14.04 Ubuntu system, I cannot configure the Java SDK to use any JDK. When I navigate to Module Settings->SDK and click configure SDK, the add button, and then select /usr/java/jdk1.8.0_25 in the dialog, I get an error popup stating that "The selected directory is not a valid home for JDK."

我检查了目录的内容,其中包含 bin 文件夹中包含 java javac ,其中 lib 文件夹和 jre 文件夹。

I've checked the contents of the directory, which contains a bin folder with both java and javac inside, a lib folder and a jre folder.

我试过选择每一个反过来,无济于事,这是我所期待的。

I've tried selecting each of those in turn, to no avail, which I expected.

推荐答案

Evan Knowles发布了一个指向https://askubuntu.com/questions/130186/what-is-the-rationale-for-the- USR目录。它为我提供了解决问题的方法。

Evan Knowles posted a link to https://askubuntu.com/questions/130186/what-is-the-rationale-for-the-usr-directory. It provided me with the solution to the problem.

而不是在 /usr/java/jdk1.8.0_25 ,我在 /usr/local/java/jdk1.8.0_25 中使用了JDK。其中有效的原因而不是其他原因在链接中有详细解释。

Instead of using the JDK at /usr/java/jdk1.8.0_25, I instead used the JDK at /usr/local/java/jdk1.8.0_25. The reasons that this works rather than the other are explained in detail within the link.

这篇关于所选目录不是JDK的有效主页 - Ubuntu上的Intellij IDEA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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