加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – 我遇到了这个异常:未解决的编译问题

发布时间:2020-12-14 05:41:45 所属栏目:Java 来源:网络整理
导读:我从项目中删除了jar(pdfbox,bouncycastle等)并将它们移动到另一个文件夹但我将它们包含在构建路径中后得到此异常… 在第一行eclipse显示此错误(构造函数PDFParser(InputStream)引用缺少类型InputStream)-altought FileInputStream是从InputStream扩展的 –
我从项目中删除了jar(pdfbox,bouncycastle等)并将它们移动到另一个文件夹但我将它们包含在构建路径中后得到此异常…

在第一行eclipse显示此错误(构造函数PDFParser(InputStream)引用缺少类型InputStream)-altought FileInputStream是从InputStream扩展的 – 我不知道为什么?

FileInputStream in = new FileInputStream(path);
PDFParser parser = new PDFParser(in);
PDFTextStripper textStripper = new PDFTextStripper();
parser.parse();
String text = textStripper.getText(new PDDocument(parser.getDocument()));

有任何想法吗?
**

Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems: 
 The constructor PDFParser(InputStream) refers to the missing type InputStream
 The constructor PDFTextStripper() refers to the missing type IOException
 The method parse() from the type PDFParser refers to the missing type IOException
 The method getText(PDDocument) from the type PDFTextStripper refers to the missing type IOException
 The method getDocument() from the type PDFParser refers to the missing type IOException
 The method getDocument() from the type PDFParser refers to the missing type IOException
 The method close() from the type COSDocument refers to the missing type IOException

**

解决方法

这只是意味着你的项目没有编译,但你仍然试图运行它. Eclipse允许您这样做,只有在您第一次尝试调用无法正确编译的内容时才会失败.

查看项目中的编译错误以追踪真正的问题.它找不到InputStream似乎很奇怪:你是否同时从代码中删除了一堆import语句?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读