Local IP address / Java Incompatibility
We found an incompatibility between Java on Solaris 2.5.1/2.6 and on Debian
2.0.r2 Could anybody suggest how to find out, if it is a bug in Debian Linux
or JDK?
Additions to the included bug report:
- $ hostname -i
129.69.183.3
gives the correct answer in a shell.
- Debian 2.0 comes with jdk-1.1.5v5-1
Thanks.
--- Begin Message ---
Hello!
I have tried to get the IP address and host name of the host running my
Java application using the following Java-Code:
InetAddress inetadr = InetAddress.getLocalHost();
System.out.println("LocalIP: " + inetadr.getHostAddress());
System.out.println("LocalName: " + inetadr.getHostName());
This works well for a SUN system, but I always get 127.0.0.1 and
localhost on my Debian Linux system. Is this a bug in Linux-Java or
is there any other way to determine the name and IP address of my
localhost???
Can anyone help me?
bye Thomas!
Below are some of my System.Properties:
-- listing properties --
user.language=en
java.home=/usr/lib/jdk1.1/bin/..
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport...
file.encoding.pkg=sun.io
java.version=cls:03/11/11-08:49
file.separator=/
line.separator=
file.encoding=8859_1
java.vendor=Sun Microsystems Inc., ported by Rand...
user.timezone=CET
user.name=schwarts
os.arch=x86
os.name=Linux
java.vendor.url=http://java.blackdown.org/java-linux....
user.dir=/home/hiwi/schwarts/RAJava
java.class.path=.:/usr/lib/jdk1.1/bin/../classes:/usr...
java.class.version=45.3
os.version=2.0.33
path.separator=:
user.home=/home/hiwi/schwarts
--- End Message ---
--
Rainer Dorsch
Abt. Rechnerarchitektur e-mail:rainer.dorsch@informatik.uni-stuttgart.de
Uni Stuttgart Tel.: 0711-7816-215
Reply to: