Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

eclipse

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.

like image 941
Cashless Avatar asked Sep 17 '25 12:09

Cashless


1 Answers

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

This fixed the problem for me.

like image 85
Rishi Penmetcha Avatar answered Sep 20 '25 05:09

Rishi Penmetcha