0

While creating a new Java 11 Project using Maven, I kept getting a now-famous error while compiling: "java error release version 5 not supported".

I was actually able to fix it by changing the Project Bytecode Version from 11 to 8. Could someone explain me why the project bytecode version can't be 11? Am I not supposed to compile to the same version of my JDK version?

1 Answers1

0

I actually found the fix for this problem and the answer is that I should be compiling to Java 11. This is what fixed my problem:

On the pom.xml file I added the following:

 <properties>
    <java.version>11</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216