qq_30968073
KeepSmile_xcl
采纳率50%
2016-04-08 06:25 阅读 1.5k
已采纳

大神门,求救啊。在线等 为什么会报这个错

这是代码
public void onClick(View v) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
System.out.println("111111111");
//String url = "home/czj/workspace/Donload/my.xml";
// Uri uri = Uri.parse(url);
//URL url = uri.
//File file = new File("file:///workspace/Donload/my.xml");
InputStream is= new FileInputStream("/home/czj/workspace/Donload/src/res/my.xml");
//FileInputStream in = new FileInputStream(file);parse("file://home/czj/workspace/Donload/my.xml");
System.out.println("222222");
//org.w3c.dom.Document document = builder.parse(new ByteArrayInputStream(data.getBytes()));
org.w3c.dom.Document document = builder.parse(new ByteArrayInputStream(data.getBytes()));

            这是报错
            java.io.FileNotFoundException: /home/czj/workspace/Donload/src/res/my.xml: open failed: ENOENT (No such file or directory)
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • 已采纳
    murphybao IT汪 2016-04-08 06:36

    你路径写错了吧,Donload是不是download

    点赞 评论 复制链接分享
  • suwu150 suwu150 2016-04-08 06:54

    my.xml 文件有没有?在src里边?

    点赞 评论 复制链接分享
  • lftaoyuan 世外大帝 2016-04-08 07:11

    特别明显,都提示出来了,找不到文件,路径写错了,仔细看路径

    点赞 评论 复制链接分享
  • qq_26737957 qq_26737957 2016-04-08 07:51

    楼主,编译后还会有src目录?

    点赞 评论 复制链接分享

相关推荐