Snippets tagged “unknownhostexception”
2 snippets use this tag.
- Getting the IP address of the current machine using JavaJava
To get the IP address of the current machine using Java, you can use the InetAddress.getLocalHost method of the java.net package.
- java.net.UnknownHostException: Invalid hostname for server: localJava
The java.net.UnknownHostException: Invalid hostname for server: local exception usually indicates that a hostname or an IP address could not be resolved. This can happen for a variety of reasons, such as: