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
You can use java.net.InetAddress API. Try this :
java.net.InetAddress
InetAddress.getLocalHost().getHostAddress();