Sometimes it can happen that PDFsam Basic doesn’t start and there is no error message or anything that could help you understand what is the issue.

First thing to do …

Is to make sure a Java Runtime version 8 or above is correctly installed on your machine (Java 8 is a requirement given PDFsam Basic is written in Java). We do all sorts of checks during the installation process and during the startup of the application to make sure we inform the user if Java 8 is missing but there might be some exotic case we missed, so first thing try upgrading Java to its latest version.

Second thing to do …

If that didn’t solve the issue you can try running PDFsam Basic using a startup script we provide in the bin subdirectory. You will find two files called pdfsam.sh for Linux systems and pdfsam.bat for Windows systems, run/double-click the one for your system, a shell/Command Prompt window will open, PDFsam Basic will try to start and a number of debug messages will show up in the shell window. Take a look at those messages and see if there is some enlightening information that can explain what is the issue.

If none of the above worked, just drop us an email attaching the not-so-enlightening debug messages in your shell window, we will try to figure out what is happening.

24 Replies to “How to debug PDFsam Basic if it doesn’t start”
  1. I can’t start the program, I am including the message below. I verified the java and is installed… could you please help me? Thank you.
    Here is the message I received:
    adrian@UbuntuStudio-Adrian:~$ pdfsam
    =========================================================================

    pdfsam

    JAVA: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin/java

    JAVA_OPTS: -Xmx256m

    CLASSPATH: /usr/share/pdfsam/pdfsam-1.1.4.jar:/usr/share/pdfsam/lib/dom4j.jar:/usr/share/pdfsam/lib/emp4j-1.0.1.jar:/usr/share/pdfsam/lib/itext.jar:/usr/share/pdfsam/lib/jaxen.jar:/usr/share/pdfsam/lib/log4j-1.2.jar:/usr/share/pdfsam/lib/looks.jar:/usr/share/pdfsam/lib/pdfsam-console-2.0.6e.jar:/usr/share/pdfsam/lib/pdfsam-jcmdline-1.0.3.jar:/usr/share/pdfsam/lib/pdfsam-langpack.jar

    =========================================================================

    /usr/bin/pdfsam: 63: /usr/bin/pdfsam: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin/java: not found
    adrian@UbuntuStudio-Adrian:~$ ^C
    adrian@UbuntuStudio-Adrian:~$

  2. Alright, so I took the courage and… edited the /usr/bin/pdfsam
    I commented a line, because I figured out there is an inexistent subdirectory in the error path, then the program started! Here is the edit — you will recognize the commented line, I only post the modified section:

    # Setup the JVM
    if [ “x$JAVA” = “x” ]; then
    if [ “x$JAVA_HOME” != “x” ]; then
    # JAVA=”$JAVA_HOME/bin/java”
    JAVA=”$JAVA_HOME”
    else
    JAVA=”java”
    fi
    fi

    I hope I did right… Thank you.

  3. Hello,

    PDFsam was working well but today I tried using it and it instantly opened and closed and if I try to launch via a terminal I get the following message :
    Exception in thread “main” java.lang.NoClassDefFoundError: javafx/scene/layout/HBox
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1009)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:801)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:699)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:622)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    at org.pdfsam.community.App.main(App.java:34)
    Caused by: java.lang.ClassNotFoundException: javafx.scene.layout.HBox
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    … 10 more

    I checked with synaptic (I am on ubuntu) and JRE 8 is installed.

    Best regards,

  4. Hmm, unfortunately this is not helpful – I can see some Java exceptions, it’s Ubuntu 18.04.01 LTS with all possible updates installed (I’ll send you guys a screenshot). Tnx anyhow, keep up the good work (I know it works on Windows 😉 )!

  5. Hello,
    i do have exactly the same problem, with the same messages when launching from a terminal. … I know it works under Win 10. But not under Ubuntu 18.04.1 LTS…
    I have tried to execute pdfsam.sh but with no success.
    Thanks for your help and regards.

  6. The program starts normally but it gave me error after we execute a command (e.q. merge):

    INFO [12:33:16]: Starting PDFsam
    INFO [12:33:17]: Configuring Sejda 3.2.38
    INFO [12:33:18]: Started in 2 seconds
    INFO [12:33:28]: laporan akhir penelitian pdd.pdf loaded
    INFO [12:33:38]: aab format – paper 3 – variance components and genetic parameters estimation.pdf loaded
    INFO [12:33:46]: Starting task (org.sejda.impl.sambox.MergeTask@16f3e531) execution.
    WARN [12:33:47]: New fonts found, font cache will be re-built
    WARN [12:33:47]: Building on-disk font cache, this may take a while
    ERROR [12:33:47]: Unexpected error
    java.lang.NoClassDefFoundError: Could not initialize class org.sejda.sambox.pdmodel.font.PDType1Font
    at org.sejda.impl.sambox.util.FontUtils.(FontUtils.java:74)
    at org.sejda.impl.sambox.component.PDDocumentHandler.close(PDDocumentHandler.java:231)
    at org.sejda.common.ComponentsUtility.nullSafeClose(ComponentsUtility.java:63)
    at org.sejda.common.ComponentsUtility.nullSafeCloseQuietly(ComponentsUtility.java:49)
    at org.sejda.impl.sambox.MergeTask.closeResources(MergeTask.java:232)
    at org.sejda.impl.sambox.MergeTask.after(MergeTask.java:237)
    at org.sejda.core.service.DefaultTaskExecutionService.actualExecution(DefaultTaskExecutionService.java:151)
    at org.sejda.core.service.DefaultTaskExecutionService.execute(DefaultTaskExecutionService.java:71)
    at org.sejda.core.service.DefaultTaskExecutionService.execute(DefaultTaskExecutionService.java:58)
    at org.pdfsam.task.TaskExecutionController.lambda$request$0(TaskExecutionController.java:87)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

  7. I am using PDFsam Basic 4.0.0. and it is showing following error

    Error occurred during initialization of VM
    java.lang.IllegalArgumentException: Null charset name
    at java.nio.charset.Charset.lookup(java.base/Unknown Source)
    at java.nio.charset.Charset.defaultCharset(java.base/Unknown Source)
    at java.lang.StringCoding.decode(java.base/Unknown Source)
    at java.lang.String.(java.base/Unknown Source)
    at java.lang.String.(java.base/Unknown Source)
    at java.lang.System.initProperties(java.base/Native Method)
    at java.lang.System.initPhase1(java.base/Unknown Source)

  8. I’ve been using pdfsam basic for years on fedora. It’s been great. Latest has been v3.3.7, works great.
    Just installed v4.0.1 from the downloaded pdfsam-4.0.1-linux.zip file. Oracle java is jdk1.8.0_112 and running pdfsam creates lots of errors and no hs_err_log after briefly displaying a startup small graphic window (screenshot available). Openjdk v1.8.0_201is also available. This gives the same small graphic and an hs_err_log file.

  9. PDF SAM Basic is not starting 🙁 here is report from bat file, please help! 🙂
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fff3e244a10, pid=11800, tid=9212
    #
    # JRE version: OpenJDK Runtime Environment (11.0.3+7) (build 11.0.3+7)
    # Java VM: OpenJDK 64-Bit Server VM (11.0.3+7, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
    # Problematic frame:
    # V [jvm.dll+0x104a10]
    #
    # No core dump will be written. Minidumps are not enabled by default on client versions of Windows
    #
    # An error report file with more information is saved as:
    # C:\Users\apawl\AppData\Local\Temp\\hs_err_pid11800.log
    #
    # If you would like to submit a bug report, please visit:
    # https://github.com/AdoptOpenJDK/openjdk-build/issues
    #
    Press any key to continue . . .

    1. Hi,
      that’s a JVM error, not really something we can fix, we will include an updated JVM in the next version though, they may have fixed that.

  10. Windows 7 – pdfsam basic 4.0.4 – java.212

    Exception in thread “WindowsNativeRunloopThread” java.lang.NoSuchMethodError:
    at com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method)
    at com.sun.glass.ui.Screen.initScreens(Screen.java:412)
    at com.sun.glass.ui.Application.lambda$run$1(Application.java:152)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Unknown Source)
    Exception in thread “WindowsNativeRunloopThread” java.lang.NoSuchMethodError:
    at com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method)
    at com.sun.glass.ui.Screen.initScreens(Screen.java:412)
    at com.sun.glass.ui.Application.lambda$run$1(Application.java:152)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Unknown Source)
    Exception in thread “JavaFX Application Thread” java.lang.NullPointerException
    at com.sun.prism.d3d.D3DPipeline.getAdapterOrdinal(D3DPipeline.java:205)
    at com.sun.javafx.tk.quantum.QuantumToolkit.assignScreensAdapters(QuantumToolkit.java:738)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:334)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:279)
    at com.sun.glass.ui.Application.lambda$run$1(Application.java:153)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Unknown Source)

  11. I just updated PDF Sam yesterday to the new version since it was 6 months I did not updated and now this new error it appears:

    Exception in thread “main” java.lang.NoClassDefFoundError: org/pdfsam/injector/Injector
    at org.pdfsam.basic.App.main(App.java:34)
    Caused by: java.lang.ClassNotFoundException: org.pdfsam.injector.Injector
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    … 1 more
    Premere un tasto per continuare . . .

  12. I am running into the following error with PDFSAM basic 4.3.0 on Rocky Linux 8 (RHEL Clone). Shouldn’t it be using the bundled JavaFX?

    347 % ./pdfsam.sh
    Jun 03, 2022 12:26:10 PM com.sun.javafx.application.PlatformImpl startup
    WARNING: Unsupported JavaFX configuration: classes were loaded from ‘unnamed module @5457464c’
    INFO 12:26:11.070 o.p.PdfsamApp[JavaFX-Launcher] Starting PDFsam
    Exception in Application start method
    Exception in Application stop method
    Exception in thread “main” java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:901)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
    at java.base/java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: javax/inject/Provider
    at org.pdfsam.injector.Injector.(Injector.java:116)
    at org.pdfsam.injector.Injector.start(Injector.java:105)
    at org.pdfsam.PdfsamApp.initInjector(PdfsamApp.java:189)
    at org.pdfsam.PdfsamApp.start(PdfsamApp.java:159)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:290)
    … 1 more
    Caused by: java.lang.ClassNotFoundException: javax.inject.Provider
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    … 13 more

  13. Error occurred during initialization of boot layer
    java.lang.module.FindException: Module jakarta.inject not found, required by org.pdfsam.basic
    Press any key to continue . . .

    1. Try closing PDFsam, uninstall it, delete leftovers (if any) from “C:\Program Files\PDFsam Basic” and “C:\Program Files (x86)\PDFsam Basic”, reinstall PDFsam. This should fix the installation.

  14. Fresh Windows 10 install, reinstalled PDFsam Basic twice, reinstalled Java, restarted the computer, etc etc.

    Error occurred during initialization of boot layer
    java.lang.module.FindException: Two versions of module org.apache.commons.io found in D:\Program Files (x86)\PDFsam Basic\app\mods (commons-io-2.13.0.jar and commons-io-2.11.0.jar)

    1. Try closing PDFsam, uninstall it, delete leftovers (if any) from “C:\Program Files\PDFsam Basic” and “C:\Program Files (x86)\PDFsam Basic”, reinstall PDFsam. This should fix the installation.

Leave a Reply

Your email address will not be published. Required fields are marked *