danger mouse
danger mouse

Reputation: 1497

Why can't I import org.apache.pdfbox.util.*?

I am writing a java program using the Apache PDFBox library. I've added the following .jar files to the java build path in Eclipse:

debugger-app-2.0.2
fontbox-2.0.2
pdfbox-2.0.2
pdfbox-app-2.0.2
pdfbox-debugger-2.0.2
pdfbox-tools-2.0.2
preflight-2.0.2
preflight-app-2.0.2
xmpbox-2.0.2

I'm not sure which ones are relevant so I added all the .jar files I could find at http://pdfbox.apache.org/download.cgi#20x.

Then, in my program, I try to import using the following:

import org.apache.pdfbox.pdfparser.*;
import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.cos.*;
import org.apache.pdfbox.util.*;

The first three lines import but the 'util' line doesn't. Any help on this would be appreciated.

Upvotes: 0

Views: 5464

Answers (1)

Migsarmiento
Migsarmiento

Reputation: 153

  1. Based on what you're importing, you only need the pdfbox-app-2.0.2.jar for now. pdfbox-app-2.0.2.jar has all the libraries you need for those imports.
  2. Have you tried cleaning the workspace? It's often the case for missing imports. If cleaning doesn't work, maybe one of the solutions in this blog will: http://blog.sherifmansour.com/?p=207

Upvotes: 2

Related Questions