Mac下Eclipse內建Tomcat埠被佔用問題的解決辦法
阿新 • • 發佈:2019-01-06
問題描述:
mac下的Eclipse中內建的Tomcat,啟動時報一下錯誤:
Several ports (8080, 8009) required by Tomcat v7.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).
解決辦法:
開啟終端,輸入以下命令
lsof -i :8080
如果你被佔用的埠不是8080,請修改命令中的引數。
該命令輸出以下內容:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 27132 kaige 41u IPv6 0x9d80e4a27fc1081b 0t0 TCP *:http-alt (LISTEN)
我的Mac上佔用8080埠的程序ID是27132,所以我再將這個程序殺死
kill -9 27132
請根據你的程序ID來修改次命令的最後一個引數
然後再次啟動Eclipse中的Tomcat,可以正常啟動了!