简体   繁体   中英

I'm getting this exception : Unresolved compilation problems

I get this exception after i removed from my project the jars (pdfbox ,bouncycastle etc) and moved them to another folder but i included them in the build path ...

at the first line eclipse shows this error( the constructor PDFParser(InputStream) refers to missing type InputStream ) -altought FileInputStream is extended from InputStream- and 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

**

That just means your project hasn't compiled, but you've still tried to run it. Eclipse lets you do that, only failing when you first try to call something which didn't compile properly.

Look at the compilation errors in your project to track down the real problem. It does seem odd that it can't find InputStream : did you remove a bunch of import statements from your code at the same time?

You may try a refresh on the project along with clean within eclipse (Project > Clean > All).

Greetz, GHad

A "missing type" error means the corresponding type is not found in the build path. InputStream would be in the JRE classpath container. Did you remove the JRE classpath container or might it be referring to a wrong location?

The second hit when searching for

"missing type" inputstream

on google might also be helpful.

Eclipse is trying to tell you that the referenced type is "missing" in the class type you are using. Imagine you have Class A, B, and C, where B references C as a field variable; while say, invoking B.setC() in class A, you will see the "refers to missing type" error, if C cannot be reached by B. So check B to see if (1) B is compiled OK, and the imported C is in compile/build path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM