Skip to main content

Migrate from version 1.14 or earlier

Version 1.15 simplifies the Java project setup. Pdftools SDK loads the native library automatically at runtime, so you no longer need platform-specific dependencies or System.load() / System.loadLibrary() calls in your code.

Learn how to replace the earlier setup for Maven, Gradle, and manual JAR management.

Maven

Remove the earlier setup

In versions 1.14 and earlier, your pom.xml contained two dependencies: the main JAR and a platform-specific native artifact with a classifier such as linux-x64, win-x64, or osx-arm64:

<!-- Remove this entire block -->
<dependency>
<groupId>com.pdftools</groupId>
<artifactId>pdftools-sdk</artifactId>
<version>1.14.0</version>
</dependency>
<dependency>
<groupId>com.pdftools</groupId>
<artifactId>pdftools-sdk</artifactId>
<version>1.14.0</version>
<classifier>linux-x64</classifier>
<type>so</type>
</dependency>

Your Java code also contained a System.load() or System.loadLibrary() call to load the native binary before using Pdftools SDK:

// Remove this line
System.load(System.getProperty("user.home") + "/.m2/repository/com/pdftools/pdftools-sdk/1.14.0/pdftools-sdk-1.14.0-linux-x64.so");

Add the new setup

Replace both dependencies with a single dependency. Remove all System.load() and System.loadLibrary() calls for Pdftools SDK from your code.

<dependency>
<groupId>com.pdftools</groupId>
<artifactId>pdftools-sdk</artifactId>
<version>1.15.0</version>
</dependency>

This single dependency includes native binaries for all supported platforms. Pdftools SDK loads them automatically at runtime.

Gradle

Remove the earlier setup

In versions 1.14 and earlier, your build.gradle contained two dependencies: the main JAR and a platform-specific native artifact:

// Remove this entire block
implementation 'com.pdftools:pdftools-sdk:1.14.0'
implementation 'com.pdftools:pdftools-sdk:1.14.0:linux-x64@so'

Your Java code also contained a System.load() or System.loadLibrary() call:

// Remove this line
System.load(System.getProperty("user.home") + "/.m2/repository/com/pdftools/pdftools-sdk/1.14.0/pdftools-sdk-1.14.0-linux-x64.so");

Add the new setup

Replace both dependencies with a single dependency. Remove all System.load() and System.loadLibrary() calls for Pdftools SDK from your code.

implementation 'com.pdftools:pdftools-sdk:1.15.0'

This single dependency includes native binaries for all supported platforms. Pdftools SDK loads them automatically at runtime.

Manual JAR management

Remove the earlier setup

In versions 1.14 and earlier, you downloaded a product kit ZIP that contained a JAR file and a lib directory with platform-specific native binaries:

lib
├── linux-x64
├── linux-arm64
├── osx-arm64
├── osx-x64
├── win-x64
├── win-x86
└── win-arm64

Your Java code contained a System.load() or System.loadLibrary() call to load the correct native binary at runtime:

// Remove these lines
System.load(new File("lib/linux-x64/libPdfToolsSdk.so").getAbsolutePath());
// or
System.loadLibrary("PdfToolsSdk");

Add the new setup

  1. Delete the earlier JAR file and the lib directory with native binaries (.dll, .so, .dylib files) from your project.
  2. Download the following JARs from Maven Central:
  3. Add both JARs to your project’s classpath.
  4. Remove all System.load() and System.loadLibrary() calls for Pdftools SDK from your code.

The pdftools-sdk-native JAR bundles the native libraries, and Pdftools SDK loads them automatically at runtime.

Further information