dedicated Linux server throws UnknownHostException.
InetAddress addr;
try {
addr = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
throw new InstantiationError("cannot find hub ip");
}
dedicated Linux server throws UnknownHostException.
InetAddress addr;
try {
addr = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
throw new InstantiationError("cannot find hub ip");
}
you might not have mapping of localhost
in your system32\drivers\etc\hosts
(win) /etc/hosts
(linux)
Another option I found was this(which I like as I don't have to repeat the hostname in both files now)...
java getLocalHost() UnknownHostException /etc/hosts file differs linux api?