SpringBoot+Maven project compilation failed and error reported

Error content

java: 无法访问org.springframework.web.bind.annotation.PostMapping
  错误的类文件: /E:/apache-maven-3.3.9/repository/org/springframework/spring-web/6.0.2/spring-web-6.0.2.jar!/org/springframework/web/bind/annotation/PostMapping.class
    类文件具有错误的版本 61.0, 应为 55.0
    请删除该文件或确保该文件位于正确的类路径子目录中。

Insert image description here

Solution

The solution can be solved by reducing the two dependency versions to 2.xx. 3.xx cannot be used.
Insert image description here

Guess you like

Origin blog.csdn.net/qq_42071369/article/details/129142422