"References to interface static methods are allowed only at source level 1.8" or above when I already have a 1.8 JRE

huangapple go评论86阅读模式
英文:

"References to interface static methods are allowed only at source level 1.8" or above when I already have a 1.8 JRE

问题

我在尝试调用我正在处理的一个Maven项目中的静态方法时遇到了这个错误。我觉得这个错误看起来很奇怪,因为我正在使用1.8版本。

此外,我在我的 pom.xml 中添加了以下内容:

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

两种解决方案似乎都没有奏效,我对此感到困惑。感谢任何帮助。

英文:

I got this error when trying to call a static method in a Maven project that I'm working on. I thought that this error seemed odd, as I'm using 1.8.

"References to interface static methods are allowed only at source level 1.8" or above when I already have a 1.8 JRE

Additionally, I added the following to my pom.xml:

    &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
    &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;

Neither solution seemed to work, and I'm puzzled as to why. Any help is appreciated.

答案1

得分: 4

右键单击项目 -> 属性 -> Java 编译器 -> 将编译器兼容性级别设置为 1.8。

这对我解决了问题。

英文:

Right click on project -> properties -> Java Compiler -> set Compiler compliance level to 1.8.

This fixed the problem for me.

huangapple
  • 本文由 发表于 2020年9月2日 06:27:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/63696261.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定