运行SpringBoot示例项目出现"Process finished with exit code 0"异常

495 阅读1分钟

按照SpringBoot的官方quickstart教程,搭建好环境运行Demo工程,但是发现IDEA出现了"Process finished with exit code 0"异常。

image.png

查阅资料发现pom.xml少了依赖导致,需要在依赖中添加spring-boot-starter-web的依赖,然后就可以解决问题。

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
</dependency>