创建jsp文件时报8080端口被占用,解决办法
问题描述:
当用户创建jsp项目时报“8080端口被占用”,不管是eclipse或idea皆可以用此方法解决。
截图:
eclipse:
idea:
截图略,但报错代码一样。
报错项目代码:
'Starting Apache Tomcat v9.0 (2) at localhost' has encountered a problem.
Port 8080 required by Apache Tomcat v9.0 (2)at localhost is 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)
@Override public void run() { bytes = mmInStream.read(buffer); mHandler.obtainMessage(READ_DATA, bytes, -1, buffer).sendToTarget(); }
原因分析:
提示:(直接翻译)
8080端口或其他自行设置的端口被其他系统所占用
解决方案:
提示:关闭相应端口即可
首先确定被占用的端口
(1)win+r输入cmd
输入命令:
(2)找所有端口:
netstat -ano
或(2)找指定端口:
netstat -ano|findstr 8080
上图红色圈起的为“pid ”
(3)在任务管理器中找到该pid,结束进程(process)即可
任务管理器快捷键:
同时按住ctrl+alt+esc即可