解决springboot在mac电脑下启动过慢的问题

自从用了mac以后,springboot启动的时候一直卡在build环节10多秒

但是在linux和Windows环境下,启动只要6秒,后面查看了一下其他

人也遇到这种问题,原来是需要在hosts文件里面加上一个配置,

废话不多说,马上开始

可以看到如下内容:

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

只需要在最后一行里面加上自己机器名即可,如下:

::1             localhost ttk-mac.local

ttk-mac是我的mac机器名。至于如何查看机器名,最简单的方法就是通过hostname命令查看。

通过这个配置,可以大幅提高spingboot项目在mac上的启动速度。

 

posted @ 2019-10-24 20:23  无影_剑  阅读(471)  评论(0编辑  收藏  举报