..

Windows 下查看端口相关

abclojure1 项目是在Windows下运行调试的,执行 lein run 提示

Syntax error (BindException) compiling at (app\service\manager.clj:9:1).
Address already in use: bind

9行的service使用的端口被占用了。于是有了下面Windows下端口操作。


  • 查看所有正在监听使用的端口
    netstat -ano
    
  • 查看指定端口使用情况
    netstat -aon|findstr "26658"
    

    输出如下

    TCP    127.0.0.1:26658        0.0.0.0:0              LISTENING       33108
    

    其中,33108 是 PID

  • kill 该 PID
    taskkill /T /F /PID 33108