How do I use PDFBox with Eclipse? Does it package in jar files?

10,150

Solution 1

  1. You will need to send both the jar you produce (from building your project) and the PDFbox jar. The PDFbox far file must be in the CLASSPATH when you run your application.

  2. Add a jar (for the purpose of building only) as follows: select the project, type ALT-Enter (or right-mouse on the project and select properties), click on "Java Build Path", click the "Add External Jars..." button, browse to the PDFbox jar file, click the "open" button, then click the "OK" button (on the properties window). The PDFBox jar file is now in the build CLASSPATH of your project. See step run concerning the runtime CLASSPATH.

Solution 2

On Mac, For me it worked when I did:

Java Build Path -> Add External Jars ->

And the location was:

/Users/yourname/.m2/repository/org/apache/pdfbox/pdfbox/1.8.x/pdfbox-1.8.x.jar
Share:
10,150
user2475183
Author by

user2475183

Updated on June 13, 2022

Comments

  • user2475183
    user2475183 almost 2 years

    I am writing a Java program in eclipse that will read in a PDF file and analyze lines of the PDF report and spit out statistics about what was read in. In order to read in the PDF file (by extracting the text), I am using PDFbox. The goal of this project is just to automate a manual process.

    Two questions:

    I've taken some java programming classes but don't have much experience in linking external binary files to eclipse.

    1. Will the PDFbox library I add to eclipse transfer over with the jar file I make? The intention is to email this jar file to a collegue to use in his day to day job to make his life easier. I just want to make sure the packaged jar file keeps the PDFbox library.

    2. How do I add the PDFbox library to eclipse so I can use the library's methods?