[英]"References to interface static methods are allowed only at source level 1.8" or above when I already have a 1.8 JRE
I got this error when trying to call a static method in a Maven project that I'm working on.尝试在我正在处理的 Maven 项目中调用 static 方法时出现此错误。 I thought that this error seemed odd, as I'm using 1.8.
我认为这个错误看起来很奇怪,因为我使用的是 1.8。
Additionally, I added the following to my pom.xml
:此外,我将以下内容添加到我的
pom.xml
:
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Neither solution seemed to work, and I'm puzzled as to why.这两种解决方案似乎都不起作用,我对原因感到困惑。 Any help is appreciated.
任何帮助表示赞赏。
Right click on project -> properties -> Java Compiler -> set Compiler compliance level to 1.8.右键单击项目 -> 属性 -> Java 编译器 -> 将编译器合规级别设置为 1.8。
This fixed the problem for me.这为我解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.