Skip to content

Instantly share code, notes, and snippets.

@freynaud
Created May 17, 2011 15:25
Show Gist options
  • Save freynaud/976681 to your computer and use it in GitHub Desktop.
Save freynaud/976681 to your computer and use it in GitHub Desktop.
cannot find IP
import java.net.InetAddress;
import java.net.UnknownHostException;
public class Launcher {
/**
* @param args
*/
public static void main(String[] args) {
InetAddress addr;
try {
addr = InetAddress.getLocalHost();
String host = addr.getHostAddress();
System.out.println(host);
} catch (UnknownHostException e) {
throw new InstantiationError("cannot find hub ip");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment