简体   繁体   中英

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.

  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

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