Linux上可以通过lsof或者netstat来查询被占用端口
如:$ lsof -i:8000
$ netstat -tulnp |grep '8000'
1. windows上查看被占用端口:
运行cmd, 执行: netstat -aon|findstr "8000"
2.查看被占用端口的进程号:
在cmd窗口, 执行: tasklist|findstr "7484"
3.杀死对应被占用的进程的执行程序
在cmd窗口, 执行: taskkill /f /t /im KGService.exe
如图: