I apt-get install pdfsam in 16.04. It doesn't work with the OpenJDK 9 (preinstalled). Author's site says it works with JDK8. So i did:

 sudo apt-get install openjdk-8-jdk  

That didn't work ,so i tried:

sudo apt-get install openjdk-8-jre  

Still nothing. Nada. Any ideas what i did wrong?

  • What happens when you open a terminal window and run pdfsam? Please edit your post to include any messages that appear. – Nick Weinberg Jun 9 '16 at 17:52
  • Make sure you have openjfx installed as well, PDFsam requires Java8 with JavaFX. – Andrea Vacondio Jun 16 '16 at 21:12

If you have multiple Java versions installed, you can set the version used by default.

Use the following command:

sudo update-alternatives --config java

I had no desire to change the system default so the fix to make pdfsam run is simply to add to your home bin directory a shell script which starts it using the the right Java flavor. Here is what I did:

$ cat ~/bin/pdfsam
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JAVACMD=$JAVA_HOME/jre/bin/java
export PATH=$PATH:$JAVA_HOME/bin


and all works fine thereafter. Even my menu shortcut works fine which pleased me (clearly did not point at the /usr/bin/pdfsam script).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.