Properly set up Java 9 as SDK in Intellij IDEA on Linux due to new folder structure

情到浓时终转凉″ 提交于 2019-11-28 08:55:49

Current debian binary package openjdk-9-jre-headless 9~b181-4 contains incorrectly compiled lib/jrt-fs.jar file.
There are 2 filed issues separately on both idea youtrack and also ubuntu launchpad.

As it is indicated here:

Probable reason:
Classes in lib/jrt-fs.jar were compiled by Java 9 with options "-source 8"/"target 8". They should be compiled with "--release 8" option instead (or by Java 8)

A temporary workaround may be replacing /usr/lib/jvm/java-9-openjdk-amd64/lib/jrt-fs.jar with the one from Oracle JDK.
You may also try to recompile the openjdk-9 source using the advised option "--release 8".

Anyway I advice to vote up this issue on the above link to attract more attention by dev team.

Use Oracle Java instead of OpenJDK for now. You can pull that in through WebUpd8's repository.

sudo add-apt-repository ppa:webupd8team/java &&
sudo apt-get update &&
sudo apt-get install oracle-java9-installer

It doesn't look like this is going to work with OpenJDK, so if you want to play with the latest and greatest Java, this is going to be the way to do it for now. Otherwise, from what I've seen, you've done this correctly and once this gets actually fixed, it will work just fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!