> 文章列表 > Idea启动遇到 Web server failed to start. Port 8080 was already in use. 报错

Idea启动遇到 Web server failed to start. Port 8080 was already in use. 报错

Idea启动遇到 Web server failed to start. Port 8080 was already in use. 报错

Idea启动遇到问题-记录
报错英文提示:


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 8080 or configure this application to listen on another port.

Process finished with exit code 1.

翻译:


应用程序无法启动


描述:

Web服务器无法启动。端口8080已被使用。

行动:

确定并停止侦听端口8080的进程,或将此应用程序配置为侦听另一个端口。

进程已完成,退出代码为1。

出现报错的原因是:

运行时,8080的默认端口被占用了。

解决方法有2种。

方法一: 改掉默认端口(8080)。例如用8081端口。

方法二: 用命令操作
1,win键+r键,输入cmd,会出现 DOS命令提示符窗口。
输入 netstat -ano|findstr “8080”,查出8080端口的进程号PID。

1

2,输入 tasklist| findstr “7448” 查出java运行 8080端口的进程号。7448

图四

3,输入命令 task kill -PID 7448 -F 结束进程。
在这里插入图片描述

如果是Linux系统:

Linux系统上查看端口、进程、结束进程

a,查看端口占用
netstat -nap|grep 8080
b,查看端口占用的进程
ps -aux |grep 27672
c,结束进程
kill -9 pid