相关推荐recommended
启动springboot项目时报错:​无法访问org.springframework.web.bind.annotation.GetMapping …具有错误的版本 61.0,应为52.0​
作者:mmseoamin日期:2024-02-20

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

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

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

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

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

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

启动成功后,如下图。

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

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

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

代码如下:

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

 

 

 

上一篇:Spring中的AOP

下一篇:SpringMVC拦截器