InetAddress.getLocalHost() resolution on OSX Lion when offline
问题 Is anyone having issues with Java's InetAddress.getLocalHost() resolution in Java with OSX Lion when working offline (i.e. not connected to internet)? It would appear that localhost:127.0.0.1 is not resolved at all: Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at java.net.InetAddress.getLocalHost(InetAddress.java:1356) Nothing special in my /etc/hosts: ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry.