How to get the real IP Address in Linux environment?
843790Oct 24 2006 — edited Oct 26 2006Hi,
I have a computer which installs Red Hat Linux OS, I use the following code to get the IP for it :
String ip = InetAddress.getLocalHost().getHostAddress();
but the ip's value is 127.0.0.1, not the real IP 192.168.222.45, but the same code works well in Windows and Solaris, how to solve the problem ?
Thanks.