一 用eclipse启动tomcat项目时报错,信息为:
Several ports (8080, 8009) required by yht 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).
二 查看占用该端口的是谁?
运行: "cmd" -->"netstat -ano",可查看端口被占用详情
C:\Users\Administrator>netstat -ano
活动连接
协议 本地地址 外部地址 状态 PID
TCP 0.0.0.0:99 0.0.0.0:0 LISTENING 1920
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 848
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:990 0.0.0.0:0 LISTENING 3364
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1880
TCP 0.0.0.0:8009 0.0.0.0:0 LISTENING 9340
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 9340
TCP 0.0.0.0:12466 0.0.0.0:0 LISTENING 9164
TCP 0.0.0.0:14001 0.0.0.0:0 LISTENING 1920
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING 544
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING 940
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING 640
TCP 0.0.0.0:49155 0.0.0.0:0 LISTENING 1000
TCP 0.0.0.0:49165 0.0.0.0:0 LISTENING 632
TCP 0.0.0.0:50313 0.0.0.0:0 LISTENING 3828
TCP 0.0.0.0:55949 0.0.0.0:0 LISTENING 6056
TCP 127.0.0.1:3306 127.0.0.1:57073 ESTABLISHED 1880
TCP 127.0.0.1:3306 127.0.0.1:57078 ESTABLISHED 1880
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 2696
TCP 127.0.0.1:5037 127.0.0.1:50900 ESTABLISHED 2696
TCP 127.0.0.1:5037 127.0.0.1:52605 ESTABLISHED 2696
TCP 127.0.0.1:5037 127.0.0.1:52606 ESTABLISHED 2696
TCP 127.0.0.1:5037 127.0.0.1:53140 ESTABLISHED 2696
TCP 127.0.0.1:5037 127.0.0.1:54131 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54134 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54137 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54141 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54145 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54148 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54151 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54154 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54157 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54160 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54163 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54166 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54169 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54172 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54175 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54178 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54182 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54185 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54188 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54191 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54194 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54199 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54203 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54206 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54209 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54212 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54215 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54218 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54221 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54225 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54232 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54235 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54240 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54243 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54248 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54253 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54257 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54260 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54265 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54268 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54271 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54274 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54277 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54282 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54285 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54289 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54292 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54295 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54299 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54302 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54305 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54308 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54312 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54316 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54321 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54324 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54327 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54330 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54333 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54336 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54339 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54342 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54345 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54348 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54351 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54354 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54357 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54360 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54363 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54366 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54371 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54374 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54377 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54380 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54383 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54387 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54390 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54393 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54396 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54399 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54402 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54407 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54410 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54415 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54418 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54421 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54424 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54429 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54432 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54435 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54438 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54441 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54445 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54449 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54452 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54455 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54458 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54461 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54465 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54468 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54471 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54474 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54479 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54482 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54485 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54489 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54492 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54495 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54498 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54501 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54504 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54508 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54511 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54514 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54517 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54520 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54523 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:54529 TIME_WAIT 0
TCP 127.0.0.1:5679 0.0.0.0:0 LISTENING 3364
TCP 127.0.0.1:6942 0.0.0.0:0 LISTENING 6028
TCP 127.0.0.1:7438 0.0.0.0:0 LISTENING 3364
TCP 127.0.0.1:8005 0.0.0.0:0 LISTENING 9340
TCP 127.0.0.1:8600 0.0.0.0:0 LISTENING 6028
TCP 127.0.0.1:8700 0.0.0.0:0 LISTENING 6028
TCP 127.0.0.1:27382 0.0.0.0:0 LISTENING 3060
TCP 127.0.0.1:50586 127.0.0.1:50587 ESTABLISHED 6028
TCP 127.0.0.1:50587 127.0.0.1:50586 ESTABLISHED 6028
TCP 127.0.0.1:50863 127.0.0.1:50864 ESTABLISHED 6028
TCP 127.0.0.1:50864 127.0.0.1:50863 ESTABLISHED 6028
TCP 127.0.0.1:50900 127.0.0.1:5037 ESTABLISHED 6028
TCP 127.0.0.1:50902 127.0.0.1:50903 ESTABLISHED 6028
TCP 127.0.0.1:50903 127.0.0.1:50902 ESTABLISHED 6028
TCP 127.0.0.1:52605 127.0.0.1:5037 ESTABLISHED 6028
TCP 127.0.0.1:52606 127.0.0.1:5037 ESTABLISHED 6028
TCP 127.0.0.1:53140 127.0.0.1:5037 ESTABLISHED 6028
TCP 127.0.0.1:54131 127.0.0.1:5037 TIME_WAIT 0
TCP 127.0.0.1:54182 127.0.0.1:5037 TIME_WAIT 0
TCP 127.0.0.1:54203 127.0.0.1:5037 TIME_WAIT 0
TCP 127.0.0.1:54232 127.0.0.1:5037 TIME_WAIT 0
TCP 127.0.0.1:54253 127.0.0.1:5037 TIME_WAIT 0
TCP 127.0.0.1:54526 127.0.0.1:5037 TIME_WAIT 0
TCP 127.0.0.1:54532 127.0.0.1:8087 SYN_SENT 4940
TCP 127.0.0.1:55500 0.0.0.0:0 LISTENING 1472
TCP 127.0.0.1:57073 127.0.0.1:3306 ESTABLISHED 1068
TCP 127.0.0.1:57078 127.0.0.1:3306 ESTABLISHED 1068
TCP 127.0.0.1:63342 0.0.0.0:0 LISTENING 6028
TCP 192.168.10.78:139 0.0.0.0:0 LISTENING 4
TCP 192.168.10.78:51755 180.153.201.27:80 CLOSE_WAIT 2880
TCP 192.168.10.78:51770 115.28.46.193:14000 TIME_WAIT 0
TCP 192.168.10.78:51772 115.28.46.193:14000 TIME_WAIT 0
TCP 192.168.10.78:51782 223.252.198.9:9092 ESTABLISHED 4940
TCP 192.168.10.78:51785 121.42.15.225:14000 TIME_WAIT 0
TCP 192.168.10.78:51786 121.42.15.225:14000 TIME_WAIT 0
TCP 192.168.10.78:51837 180.97.168.240:80 CLOSE_WAIT 4128
TCP 192.168.10.78:51847 115.29.237.29:13001 ESTABLISHED 1920
TCP 192.168.10.78:51867 211.149.209.11:14000 ESTABLISHED 1920
TCP 192.168.10.78:51868 211.149.209.11:14000 ESTABLISHED 1920
TCP 192.168.10.78:51881 218.30.35.100:14000 ESTABLISHED 1920
TCP 192.168.10.78:51882 121.42.203.84:14000 ESTABLISHED 1920
TCP 192.168.10.78:51883 182.254.145.163:14000 ESTABLISHED 1920
TCP 192.168.10.78:51884 182.254.145.163:14000 ESTABLISHED 1920
TCP 192.168.10.78:51885 121.42.203.84:14000 ESTABLISHED 1920
TCP 192.168.10.78:51886 218.30.35.100:14000 ESTABLISHED 1920
TCP 192.168.10.78:53277 114.112.73.198:80 ESTABLISHED 4940
TCP 192.168.10.78:53370 117.79.93.218:80 ESTABLISHED 4940
TCP 192.168.10.78:53829 180.153.201.27:80 CLOSE_WAIT 2880
TCP 192.168.10.78:53837 115.231.191.143:80 CLOSE_WAIT 2880
TCP 192.168.10.78:53838 115.231.191.141:80 CLOSE_WAIT 2880
TCP 192.168.10.78:54464 121.42.15.225:14000 ESTABLISHED 1920
TCP 192.168.10.78:54488 203.195.141.120:14000 SYN_SENT 1920
TCP 192.168.10.78:54507 115.28.46.193:14000 ESTABLISHED 1920
TCP [::]:135 [::]:0 LISTENING 848
TCP [::]:445 [::]:0 LISTENING 4
TCP [::]:990 [::]:0 LISTENING 3364
TCP [::]:3306 [::]:0 LISTENING 1880
TCP [::]:49152 [::]:0 LISTENING 544
TCP [::]:49153 [::]:0 LISTENING 940
TCP [::]:49154 [::]:0 LISTENING 640
TCP [::]:49155 [::]:0 LISTENING 1000
TCP [::]:49165 [::]:0 LISTENING 632
TCP [::]:50313 [::]:0 LISTENING 3828
TCP [::]:55949 [::]:0 LISTENING 6056
TCP [::1]:5679 [::]:0 LISTENING 3364
UDP 0.0.0.0:99 *:* 1920
UDP 0.0.0.0:500 *:* 1000
UDP 0.0.0.0:4500 *:* 1000
UDP 0.0.0.0:5355 *:* 1360
UDP 0.0.0.0:9387 *:* 9164
UDP 0.0.0.0:50483 *:* 6028
UDP 0.0.0.0:51746 *:* 2880
UDP 0.0.0.0:52545 *:* 3984
UDP 0.0.0.0:52546 *:* 3984
UDP 0.0.0.0:53574 *:* 2880
UDP 0.0.0.0:53607 *:* 2880
UDP 0.0.0.0:53646 *:* 9164
UDP 0.0.0.0:53647 *:* 9164
UDP 0.0.0.0:55585 *:* 2880
UDP 0.0.0.0:56506 *:* 3984
UDP 0.0.0.0:56806 *:* 2880
UDP 0.0.0.0:56914 *:* 2984
UDP 0.0.0.0:57243 *:* 4940
UDP 0.0.0.0:57760 *:* 7132
UDP 0.0.0.0:58174 *:* 2880
UDP 0.0.0.0:58175 *:* 2880
UDP 0.0.0.0:58176 *:* 2880
UDP 0.0.0.0:58925 *:* 3984
UDP 0.0.0.0:58926 *:* 3984
UDP 0.0.0.0:60845 *:* 2880
UDP 0.0.0.0:60851 *:* 3984
UDP 0.0.0.0:61493 *:* 6056
UDP 0.0.0.0:61538 *:* 7132
UDP 0.0.0.0:62142 *:* 3984
UDP 0.0.0.0:62143 *:* 3984
UDP 127.0.0.1:1900 *:* 1676
UDP 127.0.0.1:55510 *:* 1676
UDP 127.0.0.1:59263 *:* 2880
UDP 127.0.0.1:64690 *:* 2984
UDP 192.168.10.78:137 *:* 4
UDP 192.168.10.78:138 *:* 4
UDP 192.168.10.78:1900 *:* 1676
UDP 192.168.10.78:55509 *:* 1676
UDP [::]:500 *:* 1000
UDP [::]:4500 *:* 1000
UDP [::]:5355 *:* 1360
UDP [::]:61493 *:* 6056
UDP [::1]:1900 *:* 1676
UDP [::1]:55508 *:* 1676
UDP [fe80::65ce:24e8:2d0a:aa49%12]:1900 *:*
1676
UDP [fe80::65ce:24e8:2d0a:aa49%12]:55507 *:*
1676
三 杀死pid进程
方式一: 按组合键"Ctrl+Alt+Delete",进入任务管理器,将pid=9340的结束掉.
方式二 在windows系统的服务窗口,将pid=9340的结束掉.
1)在上图中,右下角点击服务,进入服务窗.
2) 使用cmd命令: 运行-"services.msc",将弹出服务窗.
注:附上百度查到的解决方案:http://jingyan.baidu.com/article/67662997372ecc54d51b8423.html