搜索
您的当前位置:首页SpringBoot项目启动超级慢的问题

SpringBoot项目启动超级慢的问题

来源:世旅网
SpringBoot项⽬启动超级慢的问题

换了新的m1芯⽚的Macboot pro,配置环境如下:

MacBook Pro (13-inch, M1, 2020)芯⽚:Apple M1

系统版本:macOS Big Surjdk:

openjdk version \"1.8.0_282\"

OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)

OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode)

然后启动springboot项⽬特别慢,我起初以为是idea和m1芯⽚的兼容问题,于是下载了针对m1芯⽚的idea版本,发现启动还是慢。仔细看了下启动⽇志,发现了这么⼀⾏:

InetAddress.getLocalHost().getHostName() took 5008 milliseconds to respond. Please verify your network configuration(macOS machines may need to add entries to /etc/hosts).

惊呆了,InetAddress.getLocalHost().getHostName() 这⼀句都能耗时超过5秒,于是执⾏下⾯的操作:

1. 在命令⾏执⾏hostname,得到主机名

2. sudo vim /etc/hosts 加⼊ 127.0.0.1 yourhostname

在这⾥差⼀条Git的问题:

gitee⾥的仓库配置了sshkey之后,执⾏ ssh -T \"git@gitee.com\" 通过了,但是⽆法push代码,提⽰错误:

remote: You do not have permission push to this repository

fatal: unable to access 'https://gitee.com/xxx/xx.git/': The requested URL returned error: 403

ssh -T 都通过了,提⽰我没有权限,Git config 设置的也没问题,查了⼀通没解决,算了,弹窗让我我⾃⼰输⼊⽤户名密码吧。执⾏如下命令,可以使得push代码的时候提⽰输⼊⽤户名密码:

git config --system --unset credential.helper

因篇幅问题不能全部显示,请点此查看更多更全内容

Top