Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm getting this exception : Unresolved compilation problems

Tags:

java

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

**

like image 713
Stephan Avatar asked Feb 16 '10 13:02

Stephan


People also ask

What does unresolved compilation problem mean?

error: unresolved compilation problem: usually occurs due to syntax or typographical errors. Also, you might get the same exception due to using unknown or undefined classes and modules. Surprisingly, this article will let you know about all the possible causes in detail.

Can not be resolved to a type java?

This means that your project isn't setup to include the JUnit libraries when it compiles; JUnit is not included in the Java runtime libraries (JRE System Library) so you have to add it to the build path.

What is Java Lang error?

This is Thrown when the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file.


2 Answers

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?

like image 61
Jon Skeet Avatar answered Nov 15 '22 12:11

Jon Skeet


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

Greetz, GHad

like image 39
GHad Avatar answered Nov 15 '22 12:11

GHad