详情
eclipse运行javaweb程序,端口被占问题及解决办法
Several ports (8005, 8080, 8009) required by Tomcat v8.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).
解决方法
1.首先在tomcat里的conf文件夹下的server.xml里面找port,确认自己访问的是正确的端口号,默认 80
此电脑为8080,若此端口被占用,就会报错。
2.接着用win+R打开cmd,输入netstat -ano
找到本地地址是0.0.0.0:8005,0.0.0.0:8080,0.0.0.0:8009所对应的PID,我这里是48740
3.占用端口号的是一个PID为48740的进程,打开任务管理器,结束PID为48740的进程.
然后再运行代码,报错就取消了。