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就好了

这样就能运行成功了

 

 

 

 

 

 

目录
相关文章
|
12月前
|
缓存
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
138 0
|
Java Spring
Spring 定时任务报错:Cron expression must consist of 6 fields (found 5 in “0 * * * *“)
Spring定时任务-cron只能包含6个字段,即使不支持年份
1189 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...
250 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.
224 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(贼简单)
|
前端开发 Java Spring
猿创征文|Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.
猿创征文|Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.
801 0
猿创征文|Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.
|
Java Spring
Spring 定时任务:Cron expression must consist of 6 fields (found 7 in "0 12 17 14 3 ? 2018")
Spring 定时任务:Cron expression must consist of 6 fields (found 7 in "0 12 17 14 3 ? 2018")
1231 0
|
IDE Java 开发工具
深入Spring Boot:怎样排查expected single matching bean but found 2的异常
写在前面 这个demo来说明怎么排查一个常见的spring expected single matching bean but found 2的异常。
6240 0