Identify and stop the process that's listening on port 8080 or configure this application to listen

因为我们SpringBoot的默认端口是server.port=8080,所以可能会导致端口占有的情况,下面这个问题可能是刚入门的时候经常会遇到的。

Identify and stop the process that's listening on port 8080 or configure this application to listen:

意思就是:确定并停止正在端口8080上侦听的进程,或将此应用程序配置为在另一个端口上侦听。

通俗的讲,就是你的端口占用了,用不了,要不就修改端口,要不就杀掉端口
在这里插入图片描述

第一种解决方法:

SpringBoot的默认端口是8080,那现在我想要让它的端口不要8080,而是8081,或者说另一个项目占用了8080,需要我们把现在的项目改成8081,那么我们就可以在application.properties文件中添加server.port=8081

server.port=8081

在这里插入图片描述
这样我们的端口就改变了
在这里插入图片描述
端口改变了,运行还是一样的,但是8080,端口需要修改成8081运行:http://localhost:8081/run

在这里插入图片描述

第二种解决方法:

博主的另一篇文章CMD查杀端口

发布了30 篇原创文章 · 获赞 28 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/weixin_44519467/article/details/104072103
今日推荐