Java code:
InetAddress.getLocalHost();
An exception is thrown, the main error message is as follows:
Solution:
Find the /etc/hosts file and configure it:
127.0.0.1 XXX
Note: For the errors in the above figure, you need to configure:
127.0.0.1 caeit