Importing and running Java samples in Eclipse

If you are using Eclipse as your IDE to run Adobe PDF Library Java sample programs, we recommend installing Eclipse Oxygen or later.

Configure the Maven package

Open Eclipse and create a new workspace. If you are not prompted for a workspace, click File and then Switch Workspace and Other.

Eclipse_01

Import the project as an existing Maven project.

Click File and Import.

Eclipse_02

After you open the Import dialog, select Maven, and then click Existing Maven Projects.

Eclipse_03

Click Next.

Eclipse_04

Click Browse and navigate to the directory where you have stored the Java sample programs.

You will want to select Java/Sample_Source as the root directory.

Eclipse_05

Under Projects, the pom.xml file should be selected.

Eclipse_06

Click Finish. The Maven plugin connectors appear.

Eclipse_07

Click Finish. You will be asked to confirm what you plan to install.

Eclipse_08

Click Next. You may be asked to review your choices, and then to accept the terms of the license agreement, Keep clicking Next as needed to step through these pages. You may need to restart Eclipse as well to complete the process.

Create a Run Configuration for a Sample Program

Reopen Eclipse as needed, and open the Maven samples project.

Eclipse_09

Click Project and Properties.

Eclipse_10

Select the Run/Debug Settings option.

Eclipse_11

Click New. Select the Java Application option.

Eclipse_12

Click OK.

Eclipse_13

Click the Search button that appears next to the Main class field.

Eclipse_14

The classes define all the samples available in the package. Click whatever sample program you want to launch.

Eclipse_15

Click the Arguments tab.

Copy and paste this text as a VM argument in the VM Arguments tab.

-Djava.library.path=target/lib

Eclipse_16

Click the Environment tab.

Eclipse_17

Click New.  Add these environment variables:

Windows

DLE_INSTALL_LOCATION=target\lib
PATH=target\lib

UNIX

DLE_INSTALL_LOCATION=target/lib
LD_LIBRARY_PATH=target/lib

Mac

DLE_INSTALL_LOCATION=target/lib
DYLD_LIBRARY_PATH=target/lib

For Windows, the add screen will look like this:

Eclipse_18

Click OK.

Eclipse_19

Click OK

Eclipse_20

Click Apply.

From here, click Run to run the sample program.