OpenJDK 9 IntelliJ IDEA (Ubuntu) “Can't resolve Symbol”

不问归期 提交于 2019-12-10 15:59:19

问题


I recently installed openJDK 9 under Ubuntu 17.10 and it seems like IntelliJ IDEA has trouble with it.

Whenever I create a new project IntelliJ can find the JDK, but it seems like it's not configuring it the right way. Here is how it looks like

when I create a HelloWorld.java example it looks like this

and it says 'Can't resolve symbol 'String''.

Everything works fine when I compile via terminal and even with Eclipse.

When I type 'java --version' it says

openjdk 9-Ubuntu

OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)

OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)

Is there a way to fix this problem?


回答1:


The problem is related to Debian packaging of openjdk-9 in the lib/jrt-fs.jar file. This file is compiled incorrectly.
This bug is reported here and there is a more complete Answer here.

If you insist to make use of openjdk you might wait for the new versions or try to build it from the source using the recommended options on the launchpad.



来源:https://stackoverflow.com/questions/47357211/openjdk-9-intellij-idea-ubuntu-cant-resolve-symbol

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