Windows XP系统下java.net.UnknownHostException:api.docear.org怎么解决
发布网友
发布时间:2022-04-25 06:24
我来回答
共1个回答
热心网友
时间:2023-11-02 22:49
调试用模拟器进行网络抓取数据功功功报java.net.UnknownHostException
问题
源码:
import java.net.*;
public class IpTest {
private String myip = null;
public static void main(String[] args) {
IpTest jt = new IpTest();
System.out.println(jt.myip);
}
public IpTest() {
try {
myip=InetAddress.getLocalHost().toString();
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
}
MyEclipse运行结:
java.net.UnknownHostException: 耿道路: ????·
at java.net.InetAddress.getLocalHost(Unknown Source)
at IpTest.<init>(IpTest.java:13)
at IpTest.main(IpTest.java:8)
null
命令提示符运行结:
耿道路/192.168.1.105
MyEclipse环境问题让程序MyEclipse能运行