由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - InetAddress.getLocalHost() in Ubuntu does not work
相关主题
How to use multicast ?[转载] ifconfig 一问
how to multicast objects to clients in java?包子求助: e3000 repeater bridge设置
java适合做实时系统吗?Re: 有没有什么网络函数能够 (转载)
JFTP 0.0.3 release如何连接mac和linux?(用crosswire cable) (转载)
what's wrong with this?求助:ubuntu上不了网(非无线)
Is MappedByteBuffer.putInt atomic?ath5k: wireless problem
Wireless 无法访问局域网won't take the eth0 config from /etc/network/interaces
why /etc/network/interfaces doesn't show "eth0"move cable from eth1 to eth0, but cannot ping eth0
相关话题的讨论汇总
话题: ubuntu话题: link话题: does话题: addr话题: work
进入Java版参与讨论
1 (共1页)
o*****l
发帖数: 539
1
I have a Ubuntu 9.04,
InetAddress.getLocalHost() does not work.
InetAddress.getLocalHost().getHostAddress() return "127.0.1.1"
while the actual ip is 192.168.21.62.
$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:24:e8:e7:95:a6
inet addr:192.168.21.62 Bcast:192.168.21.255 Mask:255.255.255.0
inet6 addr: fe80::224:e8ff:fee7:95a6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1078196 errors:0 dropped:0 overruns:0 frame:0
m*c
发帖数: 19
2
does it matter?

I have a Ubuntu 9.04,
InetAddress.getLocalHost() does not work.
InetAddress.getLocalHost().getHostAddress() return "127.0.1.1"
while the actual ip is 192.168.21.62.
$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:24:e8:e7:95:a6
inet addr:192.168.21.62 Bcast:192.168.21.255 Mask:255.255.255.0
inet6 addr: fe80::224:e8ff:fee7:95a6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1078196 errors:0 dropped:0 over

【在 o*****l 的大作中提到】
: I have a Ubuntu 9.04,
: InetAddress.getLocalHost() does not work.
: InetAddress.getLocalHost().getHostAddress() return "127.0.1.1"
: while the actual ip is 192.168.21.62.
: $ ifconfig
: eth0 Link encap:Ethernet HWaddr 00:24:e8:e7:95:a6
: inet addr:192.168.21.62 Bcast:192.168.21.255 Mask:255.255.255.0
: inet6 addr: fe80::224:e8ff:fee7:95a6/64 Scope:Link
: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
: RX packets:1078196 errors:0 dropped:0 overruns:0 frame:0

m******t
发帖数: 2416
3
It works for me. What do you get when running "hostname" from command line?

0

【在 o*****l 的大作中提到】
: I have a Ubuntu 9.04,
: InetAddress.getLocalHost() does not work.
: InetAddress.getLocalHost().getHostAddress() return "127.0.1.1"
: while the actual ip is 192.168.21.62.
: $ ifconfig
: eth0 Link encap:Ethernet HWaddr 00:24:e8:e7:95:a6
: inet addr:192.168.21.62 Bcast:192.168.21.255 Mask:255.255.255.0
: inet6 addr: fe80::224:e8ff:fee7:95a6/64 Scope:Link
: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
: RX packets:1078196 errors:0 dropped:0 overruns:0 frame:0

s******e
发帖数: 493
4
as I know, you need to run as root to get network interface list.
try to run as root to see if the pr still there.
1 (共1页)
进入Java版参与讨论
相关主题
move cable from eth1 to eth0, but cannot ping eth0what's wrong with this?
求助:虚拟机装ubuntu,有线网卡可以上网,无线网卡找不到?应该怎么办?Is MappedByteBuffer.putInt atomic?
求教网卡设置问题Wireless 无法访问局域网
把台式机的有线网络通过usb tether到手机上why /etc/network/interfaces doesn't show "eth0"
How to use multicast ?[转载] ifconfig 一问
how to multicast objects to clients in java?包子求助: e3000 repeater bridge设置
java适合做实时系统吗?Re: 有没有什么网络函数能够 (转载)
JFTP 0.0.3 release如何连接mac和linux?(用crosswire cable) (转载)
相关话题的讨论汇总
话题: ubuntu话题: link话题: does话题: addr话题: work