springboot项目-服务器启动报:java.net.BindException: 地址已在使用

阅读 50

2022-03-22

java.net.BindException: 地址已在使用
        at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_11]

原因:看下是不是上一个程序并没关闭成功

1. 查看端口占用:

netstat -anp|grep xxxx (xxxx是你springboot程序的端口号)

2. 查看pid对应的程序

ps -aux|grep -v grep|grep xxxxxx (xxxxxx是端口对应的pid,可以查到是哪个程序在占用这个端口)

3. 然后kill -9  xxxxxx    (xxxxx对应的pid)

4. 然后重启就可以成功了

精彩评论(0)

0 0 举报