我使用的是IntelliJ IDEA Ultimate 2019.3.1。每当我尝试启动任何简单的Java Maven项目(可能它甚至是一个简单的Hello World),我得到以下错误:
Error:java: error: release version 5 not supported
运行java——version by terminal得到如下输出:
openjdk 11.0.5 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Ubuntu-0ubuntu1.1)
OpenJDK 64-Bit Server VM (build 11.0.5+10-post-Ubuntu-0ubuntu1.1, mixed mode, sharing)
运行javac——version by terminal得到如下输出:
javac 11.0.5
转到Java编译器的设置(在这里建议),我看到这个:
我尝试将“目标字节码版本”编辑为1.8,但我得到以下错误:
Error:(1, 26) java: package javafx.application does not exist
Error:(2, 20) java: package javafx.stage does not exist
Error:(4, 27) java: cannot find symbol
symbol: class Application
Error:(12, 23) java: cannot find symbol
symbol: class Stage
location: class Main
Error:(7, 9) java: cannot find symbol
symbol: method launch(java.lang.String[])
location: class Main
Error:(11, 5) java: method does not override or implement a method from a supertype
将其更改为1.11版本,我得到这个错误:
Error:java: Source option 5 is no longer supported. Use 6 or later.
你认为是什么问题?我该怎么解决呢?