Caused by: java.lang.UnsupportedClassVersionError: org/springframework/boot/maven/RunMojo

Asked on January 25, 2023
In my Spring application, I upgraded spring boot version to 3. The application starts to fail on mvn spring-boot:run


Caused by: java.lang.UnsupportedClassVersionError: org/springframework/boot/maven/RunMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 60.0

How to resolve?

My pom.xml


Replied on January 25, 2023
Check the error log. After compilation, your class file version is 60.0 that is Java 16. You need class file version 61 that is Java 17.

Spring boot 3.0 works on Java 17 or higher. You need to upgrade your Java version either 17 or higher.


Replied on January 25, 2023
I installed Java 17 and now my application is working. Thanks.

Write Answer

©2024 | Privacy Policy | Contact Us