Java – I encountered this exception: an unresolved compilation problem

I removed the jar from the project( pdf@R_157_2419 @, bouncy castle, etc.) and move them to another folder, but I get this exception after I include them in the build path

On the first line, eclipse shows this error (the constructor pdfparser (InputStream) references the missing type InputStream) - altought FileInputStream is extended from InputStream - I don't know why?

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

Any ideas**

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

**

Solution

This just means that your project is not compiled, but you still try to run it Eclipse allows you to do this and only fails the first time you try to call something that cannot be compiled correctly

Look at compilation errors in your project to track down real problems It seems strange that it can't find the InputStream: did you delete a bunch of import statements from the code at the same time?

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>