Connect with one of the following accounts


Please wait while we redirect...

Views: 458 Ask New Question

Hot to get the System name/ Host name/ Machine name in Java?

On By

1 Answer

String hostName = "UNKNOWN";
try {
    hostName = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
    System.out.println("Unable to resolve host");
System.out.println("HostName is:" + hostName);
On By

Answer This Question

Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News