1、查看被占用端口。
netstat -tln
若已知端口号:
netstat -tln | grep 8080
2、查看那个程序在使用这个端口号。
lsof -i :8080
3、终止这个进程。
kill -9 PID