Here you can find the source of getHostAddress()
public static String getHostAddress()
//package com.java2s; //License from project: Open Source License import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static String getHostAddress() { try {//from w ww . ja v a 2s. com return InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException uhe) { throw new Error("Couldn't get this host address, which is needed to register in the database"); } } }