【Java】Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099

详细信息如下:

Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 	java.net.BindException: Address already in use (Bind failed)

原因:1099 端口被占用了。

解决方法:查找占用 1099 端口的进程,kill it !

PS: macOS 系统下查找端口和 kill 进程的操作命令如下:

lsof -i tcp:1099
# 或者
sudo lsof -i:1099

COMMAND  PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    3801 aaa   23u  IPv6 0x58ced0a10fc3e393      0t0  TCP *:rmiregistry (LISTEN)

然后根据 PID 杀进程:

sudo kill -9 3801

参考链接:
http://blog.csdn.net/zkp0601/article/details/49765289

posted @ 2017-07-25 15:39  WriteOnRead  阅读(1698)  评论(0编辑  收藏  举报