Intellij IDEA 2017.2无法在Linux Mint 18上添加openjk 9 [英] Intellij IDEA 2017.2 can't add openjk 9 on Linux Mint 18
问题描述
我在 Linux Mint 18.2 上使用 Intellij IDEA 2017.2.5 并尝试添加新的openjdk-9 SDK 但IDEA不接受openjdk 9为有效JDK:
I am using Intellij IDEA 2017.2.5 on Linux Mint 18.2 and trying to add new openjdk-9 SDK but IDEA does not accept openjdk 9 as valid JDK:
我已经使用ppa标准存储库中的apt-get安装了所有SDK。
这是我的 update-alternatives --config java / javac
输出:
I have installed all of my SDKs using apt-get from ppa standard repositories.
This is my update-alternatives --config java/javac
output:
< img src =https://i.stack.imgur.com/PSmu2.jpgalt =update-alternatives --config java / javac>
虽然Intellij声明它支持 JDK 9 这里,但似乎还没有与leas完全兼容t opensdk-9。
也许重构SDK目录并删除 jre 文件夹会误导IDEA找到SDK 9主文件夹。
Although Intellij declared it would support JDK 9 here, but it seems it is not yet fully compatible with at least opensdk-9.
Maybe refactoring SDK directory and removing 'jre' folder misleads the IDEA to find the SDK 9 home folder.
任何想法为什么Intellij IDEA声称'所选目录不是JDK的有效主页'?
Any idea why Intellij IDEA claims 'The selected directory is not a valid home for JDK' ?
推荐答案
Ubuntu的PPA用于OpenJDK的 目前有openjdk-9的非常旧版本( 9~b115-1ubuntu1 )。
因此IDEA不会将其识别为有效的SDK。
我删除了当前安装的版本:
" Ubuntu PPA for OpenJDK" currently has very old build of openjdk-9(9~b115-1ubuntu1).
So the IDEA does not recognize it as a valid SDK.
I removed current installed version:
sudo apt-get remove'^ openjdk-9。*'
然后我从 launchpad build archive 。
sudo dpkg -i openjdk-9-jre-headless_9_b181-4_amd64.deb
openjdk-9-jre_9_b181-4_amd64.deb
openjdk-9-jdk-headless_9_b181-4_amd64.deb
openjdk-9-jdk_9_b181-4_amd64.deb
只需在一行执行上述命令,换行就是为了更好的可读性。
Just Execute the above command at a single line, line breaks are for better readability.
忽略任何抱怨的错误:
未安装包libpng16-16。
"Package libpng16-16 is not installed."
接下来执行以下操作:
sudo apt-get install -f
现在安装了openjdk-9的这个版本之后,IDEA很满意SDK home。
Now after installing this build of openjdk-9 the IDEA is happy with SDK home.
感谢 @ y.bedrov 他有用的评论。
更新:
但是这个解决方案可以让您在提到的IDEA版本(2017-2)中声明openjdk-9但是你无法在IDEA内编译任何类。
您只能使用elder jdk编译应用程序并使用openjdk-9运行它。这里是这里表示该的其他问题。
Update: However this solution enables you to declare openjdk-9 in the mentioned IDEA version(2017-2) but you are not able to compile any class within the IDEA itself. You can only compile your application with elder jdk and run it with openjdk-9. There is an other issue which indicates this here.
在较新的IDEA版本(我已经测试过2017.3)中,不再允许将这个openjdk版本用作新的SDK,请参阅this问题。
In the newer IDEA versions(I have tested 2017.3) this build of openjdk is not allowed to be used as new SDK any more, see this issue.
简短的原因是Debian软件包中存在错误编译的lib / jrt-fs.jar文件的问题。
The short reason is an issue in Debian package which contains incorrectly compiled lib/jrt-fs.jar file.
这篇关于Intellij IDEA 2017.2无法在Linux Mint 18上添加openjk 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!