启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​

启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​

报错原因:jdk版本1.8 与 spring boot 3.0.1 版本不匹配

解决方案:将springboot版本降级即可(比如2.5.4就是稳定版本)。如下图:

启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​

 注意:修改完成后刷新下maven,如下图。

启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​

启动成功后,如下图。

启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​ 由上图可知,启动时携带的端口是8080,context path是空,也就是说访问时一个斜杠就可以,在浏览器上访问,如下图。

启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​

启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​

代码如下:

启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​ 注:这是个最基本的springboot程序。 

 

 

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/ba7bde2d6c.html