I can't get the correct IP address on Linux...
The following code works properly on Windows and Unix.
But on Linux, I always get the Loopback Address (127.0.0.1)
Here is the code :
//gets the IP via InetAddress class
//works on UNIX and WIN, but not on LINUX !!
InetAddress hostIP = InetAddress.get LocalHost();
String hostIPStr = hostIP.getHostA ddress();
Could anyone help ?
Thanks in advance !
dim
The following code works properly on Windows and Unix.
But on Linux, I always get the Loopback Address (127.0.0.1)
Here is the code :
//gets the IP via InetAddress class
//works on UNIX and WIN, but not on LINUX !!
InetAddress hostIP = InetAddress.get LocalHost();
String hostIPStr = hostIP.getHostA ddress();
Could anyone help ?
Thanks in advance !
dim
Comment