mac启动springboot失败,8080端口被占用,mac命令行关闭端口

13 篇文章 0 订阅
12 篇文章 0 订阅

如下图,idea启动springboot失败,8080端口被占用

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-05-23 22:18:43.688 ERROR 3793 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Web server failed to start. Port 8020 was already in use.

Action:

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

mac下怎么使用命令行关闭端口呢?

打开mac终端,或者idea的终端,输入:

lsof -i:端口号(我的是8020,那么输入如下命令)
lsof -i:8020

输入 lsof -i:8020 后回车

bogon:it399_springboot chenshouyin$ lsof -i:8020
COMMAND  PID        USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    1472 chenshouyin  120u  IPv6 0x71c9463ce2ac6f49      0t0  TCP *:intu-ec-svcdisc (LISTEN)
bogon:it399_springboot chenshouyin$ 

可以看到我的端口对应的进程id是1472,那么kill这个进程即可

mac下关闭进程

kill 进程id,上面我的进程id是1472,那么直接输入如下命令即可

kill 1472

关闭占用端口的进程之后,再启动springboot不再报错了
 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值