org.springframework.boot:spring-boot-starter-parent’ not found

简介: org.springframework.boot:spring-boot-starter-parent’ not found

一、问题

用 Spring Initializr创建的项目,然后点进pom.xml文件,有好几处变红,且报错,且DemoApplication报无法解析符号 ‘SpringBootApplication’

现在这个文件无法启动,且java无法创建类和接口,点击下方加载maven项目就好了

然后现在开始变红报错了,说无法解析符号 'SpringBootApplication'

以下是pom.xml开始报错

下面这个说找不到项目 'org.springframework.boot:spring-boot-starter-parent:3.1.2.RELEASE'

下面这个说找不到依赖项 'org.springframework.boot:spring-boot-starter-test:'  

二、解决

我把这个地方换成了2.1.8这个版本就好了

然后下方也不变红,报错了

然后点击maven刷新一下就好了

DemoApplication文件也不报错了

运行时报java: 错误: 无效的源发行版:16

然后把这个地方的17改成8

把下方的两个16都改成8,然后刷新一下maven就好了

这样就能运行成功了

 

 

 

 

 

 

目录
相关文章
|
6月前
|
JSON 前端开发 Java
解决Spring MVC中No converter found for return value of type异常
在Spring MVC开发中遇到`No converter found for return value of type`异常,通常是因缺少消息转换器、返回值类型不支持或转换器优先级配置错误。解决方案包括:1) 添加对应的消息转换器,如`MappingJackson2HttpMessageConverter`;2) 自定义消息转换器并实现`HttpMessageConverter`接口,设置优先级;3) 修改返回值类型为如`ResponseEntity`的合适类型。通过这些方法可确保返回值正确转换为响应内容。
509 1
|
2月前
|
Java API 开发者
【已解决】Spring Cloud Feign 上传文件,提示:the request was rejected because no multipart boundary was found的问题
【已解决】Spring Cloud Feign 上传文件,提示:the request was rejected because no multipart boundary was found的问题
313 0
|
3月前
|
Java Spring
【Azure Spring Cloud】Spring Cloud Azure 4.0 调用Key Vault遇见认证错误 AADSTS90002: Tenant not found.
【Azure Spring Cloud】Spring Cloud Azure 4.0 调用Key Vault遇见认证错误 AADSTS90002: Tenant not found.
|
5月前
|
IDE Java Maven
Spring Boot启动失败问题:hile scanning for the next token found character '@'
Spring Boot启动失败问题:hile scanning for the next token found character '@'
225 0
|
缓存
Project ‘org.springframework.boot:spring-boot-starter-parent:1.5.7.RELEASE‘ not found
Project ‘org.springframework.boot:spring-boot-starter-parent:1.5.7.RELEASE‘ not found
|
缓存
project ‘org.springframework.boot:spring-boot-starter-parent:2.1.4.RELEASE‘ not found
project ‘org.springframework.boot:spring-boot-starter-parent:2.1.4.RELEASE‘ not found
172 0
|
Java Spring
Spring 定时任务报错:Cron expression must consist of 6 fields (found 5 in “0 * * * *“)
Spring定时任务-cron只能包含6个字段,即使不支持年份
1363 0
|
Java
问题排查之'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' that could not be found.- Bean metho...
问题排查之'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' that could not be found.- Bean metho...
352 0
|
应用服务中间件
TOMCAT部署项目报错,More than one fragment with the name [spring_web] was found.
TOMCAT部署项目报错,More than one fragment with the name [spring_web] was found.
320 0
TOMCAT部署项目报错,More than one fragment with the name [spring_web] was found.
|
Java Spring
spring boot Configuration Annotation Proessor not found in classpath(贼简单)
spring boot Configuration Annotation Proessor not found in classpath(贼简单)