Todd
Todd

Reputation: 1822

Import cannot be resolved in Eclipse from dependency in Play 2.0

I successfully added a dependency in Play 2.0 and was able to compile the project. When I try to run a simple test to render a PDF I get this error:

The import com.itextpdf cannot be resolved

import com.itextpdf.text.Document; 
import com.itextpdf.text.DocumentException; 
import com.itextpdf.text.Paragraph; 
import com.itextpdf.text.pdf.PdfWriter; 

How do I clear this error with Play managing this dependency?

Upvotes: 2

Views: 3466

Answers (2)

Marco RS
Marco RS

Reputation: 8245

I solved this problem by running "play eclipse" on my project in command line and then Project-->Clean in Eclipse. Similarly for Intellij "play idea" and then File > Invalidate Caches > Invalidate and restart.

Upvotes: 2

Martijn
Martijn

Reputation: 12102

If the dependency is properly added, the jar should now be on the build path. Could you check if it actually is on your buildpath? Note that the /lib directory of your project is automatically included. You could try making a symlink in /lib to the jar

Upvotes: 0

Related Questions