Skip to content
Advertisement

java.lang.UnsupportedClassVersionError org/springframework/boot/loader/JarLauncher has been compiled by a more recent version of the Java Runtime

I understand that this question has been asked many times in Stack Overflow and I have researched many of them, so please check this.

JavaScript

My pom file:

JavaScript

Both my maven.compiler.target and maven.compiler.source are set to 1.8 and i have java 1.8 running in my mac (M1).

JavaScript

I am not sure why I am still getting the issue.

Advertisement

Answer

The error indicates that the Spring class org.springframework.boot.loader.JarLauncher has class version 61 (Java 17). Spring Boot 3 requires Java 17. You cannot use it on Java 8, even if you compile your own classes targeting Java 8.

If you want to use Spring Boot 3, you will need to upgrade to Java 17, otherwise you need to remain on Spring Boot 2.7.x or lower.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement