Equipment: the Macbook – Pro2020

System: MacOS 11.2.3

The JDK: 1.8

Development environment: IDEA 2021.3

Began to start the project found that did not appear immediately Springboot trademark icon, a closer look at the console output time 22 s, had ignored the first warning java.net.InetAddress.getLocalHost (), did not react immediately.

On the contrary, I thought the problem was caused by the system upgrade or the BUG of IDEA. Later, I searched a lot of problems and found that they seemed to have nothing to do with the system and IDEA.

It is pointed out that JDK1.8 Springboot has a specific BUG on the Mac system, which will cause the host resolution failure, resulting in a startup delay, and you need to manually configure the host.

In practice, after manual configuration, the startup speed soared from 22s to 1.6s, a huge improvement.

The configuration method is as follows:

1. Open terminal or another command-line tool

2. Enter hostname to obtain the name of the host and copy it

3. Enter sudo vi /etc/hosts and press Enter to enter the MAC password

4. Type xxxdemacbookpro. local and replace it with your own hostname

127.0.0.1 localhost xxxdemacbook-pro. local ::1 local xxxdemacbook-pro.localCopy the code

5. Save the Settings and restart the project to test the speed.