Java – localhost cannot be resolved to 127.0 zero point one
I'm going to call inet4address Getbyname ("localhost") expects to see 127.0 0.1, but I see my IP assigned to my Ethernet / airport If I disconnect the Ethernet / Airport connection, I will get 127.0 0.1 resolution, but once I connect again, it will resolve to Ethernet / Airport IP address
I use OSX 10.6 7 and Java version "1.6.0_24" My / etc / hosts file has "127.0.0.1 localhost" Ping localhost in the terminal does resolve to 127.0 0.1.
The reason why I need this is that I am developing GWT. I have a different JVM trying to call GWT hosting mode. I get a connectionexception: the connection is rejected if the localhost does not resolve to 127.0 0.1.
thank you
Solution
I have the same problem because my host name is set to localhost I changed it and it solved the problem