Web server failed to start. Port 8080 was already in use.(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.

方法1:关掉占用8080端口的进程

  1. 键盘输入(win+r),接着在运行对话框中输入“cmd”,进入命令窗口
  2. 输入netstat -ano|findstr "8080",回车,如下图显示:

        

    3.接着输入tasklist|findstr "3516",回车得到占用8080端口的进程

        

 

    4.打开“任务管理器”,定位改进程,然后结束进程,8080端口占用被取消

 

     

或者使用命令关闭:taskkill -PID 3516 -F 

 

方法二:修改配置文件,使用其他的可用端口

我们可以修改application.yml配置文件中port端口号,如下图

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

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

 

 

 
posted @ 2021-04-07 14:02  LilLazy  阅读(3605)  评论(0编辑  收藏  举报