I am trying to develop a system where there are different nodes that are run on different system or on different ports on the same system.
Now all the nodes create
Use InetAddress.getLocalHost() to get the local address
import java.net.InetAddress; try { InetAddress addr = InetAddress.getLocalHost(); System.out.println(addr.getHostAddress()); } catch (UnknownHostException e) { }