[已解决]Springboot项目启动时端口被占用

目录

1.打开CMD窗口

2.找到端口号

3.找到对应程序

4.终止任务

5.再次查询端口,没有找到对应的端口号说明进行杀死成功

6. 重新启动项目,可以正常启动


Springboot端口号默认8080,启动时经常会遇到端口号被占用的情况,报错信息如下:

Description:

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

Action:

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


Process finished with exit code 1

解决办法:

1.打开CMD窗口
2.找到端口号
netstat -aon|findstr  “8680”
3.找到对应程序
tasklist | frindstr 进程号
4.终止任务
taskkill /f /t /im java.exe
5.再次查询端口,没有找到对应的端口号说明进行杀死成功
netstat -aon|findstr  “8680”

[已解决]Springboot项目启动时端口被占用_第1张图片

6. 重新启动项目,可以正常启动

[已解决]Springboot项目启动时端口被占用_第2张图片

方法还有很多,也可以直接终止任务管理器对应的进程号

[已解决]Springboot项目启动时端口被占用_第3张图片

你可能感兴趣的:(异常解决,SpringBoot,服务器,linux,数据库,spring,boot,后端,java)