Several ports (8005, 8080, 8009) required by Tomcat v9.0 Server at localhost are already in use.

eclipse启动Tomcat报错,显示8005, 8080, 8009端口被占用

问题描述

eclipse启动Tomcat报错:

Several ports (8005, 8080, 8009) required by Tomcat v9.0 Server at
localhost are already in use. The server may already be running in
another process, or a system process may be using the port. To start
this server you will need to stop the other process or change the port
number(s).

图示:
Several ports (8005, 8080, 8009) required by Tomcat v9.0 Server at localhost are already in use._第1张图片

解决方法

第一步:找到端口号对应的进程,也就是找到该进程标识符PID

  • 方法一:命令行键入 netstat -ano
    该命令列出所有端口的情况,在列表中我们可以看到被占用的端口的使用情况,比如这里的8005, 8080, 8009三个端口,他们的进程标识符,为13604 ,也就是这三个端口被PID为 13604 的进程占用;
    Several ports (8005, 8080, 8009) required by Tomcat v9.0 Server at localhost are already in use._第2张图片
  • 方法二:命令行键入 netstat -aon | findstr 8080
    该命令可以查看指定的端口号的使用情况,查看其PID;
    在这里插入图片描述

第二步:找到进程标识符PID对应的那个程序,禁用或结束它

  • 方法一:
    打开任务管理器,选择 详细信息,查看PID 为 13604 所对应的进程或程序,这里是javaw.exe ,然后右击禁用或结束该进程即可
    Several ports (8005, 8080, 8009) required by Tomcat v9.0 Server at localhost are already in use._第3张图片
  • 方法二:知道了PID,直接通过他结束进程
    命令行输入 taskkill /pid 13604 /f
    该命令可以将进程号指定的进程结束掉;
    在这里插入图片描述
    结束进程后,再次启动 Tomcat 成功

你可能感兴趣的:(报错处理)