关于idea搭建SpringBoot启动时:Process finished with exit code 0解决办法 - Go语言中文社区

关于idea搭建SpringBoot启动时:Process finished with exit code 0解决办法


以前都用eclipse的,最经看springboot书籍,使用idea(springboot initializr)快速搭建springboot项目,一路next;


启动时候:Process finished with exit code 0,这不是错;

意思是:这个表示程序正常执行完毕退出了。

这就表示项目启动成功后了,此时运行,最后运行完毕自动退出。


而现在我们想要的是启动项目访问路径,我们需要的是springmvc的框架(可以使用一些注解如:@RestController,@RequestMapping),在springboot里面我们需要引入web这个依赖;

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
</dependency>
然后添加代码:

然后启动即可(默认是8080,如果想修改端口号修改配置文件,application.yml):

http://localhost:8080/

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/weixin_38391672/article/details/80980706
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-06-28 03:05:55
  • 阅读 ( 1289 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

推荐文章

猜你喜欢