Migrate from version 1.11 or earlier
Toolbox add-on 1.12+ simplifies the Java project setup. Toolbox add-on 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.11 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>toolbox</artifactId>
<version>1.11.1</version>
</dependency>
<dependency>
<groupId>com.pdftools</groupId>
<artifactId>toolbox</artifactId>
<version>1.11.1</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 Toolbox add-on:
// Remove this line
System.load(System.getProperty("user.home") + "/.m2/repository/com/pdftools/toolbox/1.11.1/toolbox-1.11.1-linux-x64.so");
Add the new setup
Replace both dependencies with a single dependency. Remove all System.load() and System.loadLibrary() calls for Toolbox add-on from your code.
<dependency>
<groupId>com.pdftools</groupId>
<artifactId>toolbox</artifactId>
<version>1.12.0</version>
</dependency>
This single dependency includes native binaries for all supported platforms. Toolbox add-on loads them automatically at runtime.
Gradle
Remove the earlier setup
In versions 1.11 and earlier, your build.gradle contained two dependencies: the main JAR and a platform-specific native artifact:
// Remove this entire block
implementation 'com.pdftools:toolbox:1.11.1'
implementation 'com.pdftools:toolbox:1.11.1: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/toolbox/1.11.1/toolbox-1.11.1-linux-x64.so");
Add the new setup
Replace both dependencies with a single dependency. Remove all System.load() and System.loadLibrary() calls for Toolbox add-on from your code.
implementation 'com.pdftools:toolbox:1.12.0'
This single dependency includes native binaries for all supported platforms. Toolbox add-on loads them automatically at runtime.
Manual JAR management
Remove the earlier setup
In versions 1.11 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/libPdfTools_Toolbox.so").getAbsolutePath());
// or
System.loadLibrary("PdfTools_Toolbox");
Add the new setup
- Delete the earlier JAR file and the
libdirectory with native binaries (.dll,.so,.dylibfiles) from your project. - Download the following JARs from Maven Central:
toolbox-1.12.0.jar(binding layer; sources JAR, Javadoc JAR)toolbox-native-1.12.0.jar(native libraries)
- Add both JARs to your project’s classpath.
- Remove all
System.load()andSystem.loadLibrary()calls for Toolbox add-on from your code.
The toolbox-native JAR bundles the native libraries, and Toolbox add-on loads them automatically at runtime.
Further information
- For the full setup instructions, see the Java getting started guide.
- For other changes in version 1.12, see the release notes.