美文网首页
springboot启动失败,8080端口被占用

springboot启动失败,8080端口被占用

作者: 懒得代码 | 来源:发表于2020-12-24 18:35 被阅读0次

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

如下图,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 8080 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终端,或者idea的终端
输入: lsof -i:8080 (lsof -i:端口号)

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

COMMAND  PID        USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    1472 test  120u  IPv6 0x71c9463ce2ac6f49      0t0  TCP *:intu-ec-svcdisc (LISTEN)

第二步:mac下关闭进程,使用kill命令

kill 1472

关闭进程后重新运行SpringBoot,就可以正常运行了。

如果有一同学习java的同学可以加我qq裙:636984730,一起交流。

相关文章

网友评论

      本文标题:springboot启动失败,8080端口被占用

      本文链接:https://www.haomeiwen.com/subject/hlzmnktx.html