Linux程序和Java程序的UnknownHostException

时间:2014-01-08 18:40:51

标签: java linux opensuse suse

在suse 32bits上,我尝试运行java应用程序,我收到此错误

java.net.UnknownHostException:linux-7w1q.site:linux-7w1q.site:名称或服务未知

我检查了我的/ etc / hosts文件

127.0.0.1       localhost linux-7w1q
# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts

但似乎没问题

1 个答案:

答案 0 :(得分:1)

错误消息显示您正在寻找linux-7w1q.site,但您的/etc/hosts别名为linux-7w1q