Search code examples
javamavenintellij-ideabuildconfiguration

Intellij: SDK 17 is not compatible with the source version 17


I am trying to get a project to build in IntelliJ but I keep getting an error. I have tried different JDKs such as the jet brains and OpenJDK but I always get this error

enter image description here

Everything I have seems to be pointing to java 17 so I feel a bit confused

pom.xml

enter image description here

Project Structure

enter image description here enter image description here enter image description here

Java compiler settings

enter image description here

Maven Runner Settings

enter image description here

I feel like it could have to do with my project layout?

enter image description here


Solution

  • Your maven.compiler.source and maven.compiler.target values are wrong.

    Replace 1.17 and set it instead to 17 per JEP 223.

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