idea2018 Error:(3, 32) java: cannot access org.springframework.boot.SpringApplication

Error:(3, 32) java: cannot access org.springframework.boot.SpringApplication
  wrong class file: C:\Users\86131\.m2\repository\org\springframework\boot\spring-boot\3.1.0\spring -boot-3.1.0.jar (org/springframework/boot/SpringApplication.class)
    class file has wrong version 61.0, should be 52.0
    Please delete the file or make sure it is in the correct classpath subdirectory.

1. Reason: At least jdk17 is required to use springboot3.*.*. Using jdk8 will report an error

2. Solution:

(1) Method 1: Reinstall jdk, at least jdk17 version

(2) Method 2: Modify the springboot version of the project to a version below springboot3. If it is a new project, you can delete and recreate it, and choose a version below springboot3. If it is an existing project, then modify the version of springboot (the specific method to Baidu)

      Deleting the project and rebuilding is to pay attention to choosing the version of springboot here:

 

 

Guess you like

Origin blog.csdn.net/weixin_45813351/article/details/130915007