Skip to main content

Springbot startup error - class file has wrong version 61.0, should be 52.0

When starting the Springboot project, an error java is reported: Unable to access org.springframework.boot.SpringApplication error class file: /D:/Maven/apache-maven-3.6.3/repository/org/springframework/boot/spring-boot/3.0.0 The /spring-boot-3.0.0.jar!/org/springframework/boot/SpringApplication.class class file has the wrong version 61.0, should be 52.0. Please delete the file or make sure it is in the correct classpath subdirectory.

1.png

reason

SpringBoot uses 3.0 or above. Since Spring's official release supports at least JDK17 starting from Spring 6 and SpringBoot 3.0, you only need to reduce the SpringBoot version to below 3.0.

2.png

Feel free to lower the SpringBoot version to a version below 3.0, refresh Maven and restart

3.png

Summarize:

The era of "you can use Java8 as you please" may be about to change. jdk17 surpasses Java8 in terms of GC, features and other aspects. In addition, JDK17 is an LTS version that Oracle officially announced can be used for free commercial use. The so-called LTS , is Long Term Support, which is the version that is officially guaranteed to be supported for a long time. JDK 17 can be supported until September 2029 at most. According to the speed of technology update and iteration, this free commercial use for 8 years is a good intention, in order to allow users to confidently and boldly upgrade JDK to JDK 17 (however, JDK 8 is supported for a longer period of time and can be extended to 12 in 2030. (JDK8 can be said to be YYDS!) JDK 17 will be the most important LTS version since Java 8 and is the result of eight years of hard work by the Java community. However, it is said that JDK21 is more worth looking forward to.