解决方法:

  1. 查找被占用的端口

netstat -tln   #查看端口的使用情况
netstat -tln|grep 8080 #只查看端口8080的使用情况


  1. 查看端口属于哪个程序?端口被哪个程序占用

lsof -i :8080


  1. 杀死占用端口的进程

kill -9 进程id