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

Viewed 1720

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.

Eclipse says I'm already using a 1.8 JRE

Additionally, I added the following to my 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.

1 Answers

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

This fixed the problem for me.

Related