-
-
Notifications
You must be signed in to change notification settings - Fork 383
Build and run
Junming Chen edited this page Nov 13, 2025
·
6 revisions
- OpenJDK 21 - PDFsam requires JDK 21 (NOT JDK 11)
- Maven - Build tool for dependency management
-
Gnu gettext - Required for internationalization
- Windows: http://mlocati.github.io/gettext-iconv-windows/
- macOS: Install via Homebrew or use Docker (see below)
- Linux: Usually pre-installed or available via package manager
- Clone the PDFsam repository
- Checkout the tag/branch you want to build (e.g.,
git checkout v5.4.1)
Note: Homebrew's OpenJDK 21 does not work. Use Liberica OpenJDK 21 instead.
- Download and install Liberica JDK 21
- Set JAVA_HOME and build:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/liberica-jdk-21.jdk/Contents/Home
# Build with tests
mvn clean package -Drelease
# Build without tests (faster)
mvn clean package -Drelease -DskipTestsNote: You may see a signing certificate error - this can be safely ignored for local testing.
If you have JDK 21 and gettext installed:
# Build with tests
mvn clean package -Drelease
# Build without tests (faster)
mvn clean package -Drelease -DskipTestsBuild without installing dependencies on your system using Docker:
docker run --rm -v "$PWD":/app -w /app mcr.microsoft.com/openjdk/jdk:21-ubuntu \
bash -c "apt-get update && apt-get install -y maven gettext && mvn clean package -Drelease -DskipTests"Important Notes:
- Use Microsoft's OpenJDK image (
mcr.microsoft.com/openjdk/jdk:21-ubuntu) as it includes the full JDK with jmods directory required forjlink - The Liberica
liberica-openjdk-debian:21image lacks jmods and will fail during the jlink step - macOS users: The Docker build creates Linux-specific binaries (bundled runtime + JavaFX native libraries) that cannot run on macOS. You must use the native macOS build (see macOS section above) to create runnable macOS applications
After building, find the assembled application in pdfsam-basic/target/assembled/:
pdfsam-basic/target/assembled/bin/pdfsam.sh