为了账号安全,请及时绑定邮箱和手机立即绑定

老是,我这写的URL出现这个情况?

java.net.UnknownHostException: www.baidu.com

at java.net.AbstractPlainSocketImpl.connect(Unknown Source)

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at sun.net.NetworkClient.doConnect(Unknown Source)

at sun.net.www.http.HttpClient.openServer(Unknown Source)

at sun.net.www.http.HttpClient.openServer(Unknown Source)

at sun.net.www.http.HttpClient.<init>(Unknown Source)

at sun.net.www.http.HttpClient.New(Unknown Source)

at sun.net.www.http.HttpClient.New(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

at java.net.URL.openStream(Unknown Source)

at com.helloworld.HelloWorld.main(HelloWorld.java:33)


正在回答

2 回答

我碰到了一样的问题,同样的代码在家中电脑上运行没问题,在公司电脑运行却一直报这个错误。

0 回复 有任何疑惑可以回复我~

换了好几个网址都不行

0 回复 有任何疑惑可以回复我~
#1

1995flx

没加http://吗?
2016-02-10 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

老是,我这写的URL出现这个情况?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信