1. 程式人生 > >linux系統部署Java程序獲取ip時報Caused by: java.net.UnknownHostException: XXXXXXXXXX: XXXXXXXXXX: Name or service not known

linux系統部署Java程序獲取ip時報Caused by: java.net.UnknownHostException: XXXXXXXXXX: XXXXXXXXXX: Name or service not known

xxx ice 問題 clas java 獲取ip 獲取 code 系統部署

問題一:
Caused by: java.net.UnknownHostException: XXXXXXXXXX: XXXXXXXXXX: Name or service not known

vi /etc/hosts
127.0.0.1 iZuf68tztea6l5ccdz7wemZ

XXXXXXXXXX自己的主機名

linux系統部署Java程序獲取ip時報Caused by: java.net.UnknownHostException: XXXXXXXXXX: XXXXXXXXXX: Name or service not known