用SpringInitializr创建的第一个项目就报这个错误 开始以为是端口被占用,但查看端口占用情况后,排除了这种情况 后台到网上找,有人说是maven版本和idea版本对不上,有人说是jdk版本跟spring不匹配,但试了之后发现都不是,最后看到这篇博文(215条消息) 【错误】启动项目时,出错:(Disconnected from the target VM, address: ‘127.0.0.1:64718‘, transport: ‘socket‘)_disconnected from the target vm, address: '127.0.0_就是不倒翁的博客-CSDN博客 在pom.xml中将这段代码
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>compile</scope>
<version>5.3.24</version>
</dependency>
改为:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.5</version>
</dependency>
后,就好了