InetAddress.getLocalHost()运行缓慢

InetAddress.getLocalHost()运行缓慢,第1张

InetAddress.getLocalHost()运行缓慢

这个是 macos 存在的一个问题,解决方案如下:

在 /etc/hosts 中添加本地 hostname 的 dns 解析,执行 hostname 命令,将 hostname 命令输出的结果添加到 /etc/hosts 中,类似于:

127.0.0.1   localhost xxx.local
::1         localhost xxx.local

参考:
https://thoeni.io/post/macos-sierra-java/

https://stackoverflow.com/questions/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds

https://github.com/spring-projects/spring-boot/issues/7087

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5704667.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存