Pdfsam yields Java Error

My command

pamac build --no-clone pdfsam

succeded (see below), however, if I start pdfsam, I see a Java Error:

[achat ~]# pdfsam
Run with exported 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/pdfsam/basic/App has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)

Can I fix the problem by modifying some config file?

Here is the log of the build process:

pamac build --no-clone  pdfsam
Warnung: Erstelle Pakete als Root
Warnung: Konfiguriere Build-Verzeichnis /var/cache/pamac
Vorbereitung...
Generiere pdfsam Informationen...
Überprüfe pdfsam Abhängigkeiten...
Abhängigkeiten werden aufgelöst...
Interne Konflikte werden überprüft...

Wird installiert (8):
  patch     2.7.6-8                           core       
  m4        1.4.19-1                          core       
  flex      2.6.4-3                           core       
  fakeroot  1.26-1                            core       
  autoconf  2.71-1                            core       
  bison     3.8.2-1                           core       
  automake  1.16.5-1                          core       
  gendesk   1.0.8-1   (Benötigt von: pdfsam)  community  
Zu erstellen (1):
  pdfsam    4.2.8-1                           AUR

Gesamtgröße installiert: 16,0 MB

Build-Dateien bearbeiten : [e] 
Transaktion anwenden ? [e/j/N] j

Überprüfe Schlüsselring...                                                                                                                                                               [8/8]
Integrität wird überprüft...                                                                                                                                                             [8/8]
Paketdateien werden geladen...                                                                                                                                                           [8/8]
Dateikonflikte werden überprüft...                                                                                                                                                       [8/8]
Überprüfe verfügbaren Speicherplatz...                                                                                                                                                   [8/8]
Installiere m4 (1.4.19-1)...                                                                                                                                                             [1/8]
Installiere autoconf (2.71-1)...                                                                                                                                                         [2/8]
Installiere flex (2.6.4-3)...                                                                                                                                                            [3/8]
Installiere gendesk (1.0.8-1)...                                                                                                                                                         [4/8]
Installiere automake (1.16.5-1)...                                                                                                                                                       [5/8]
Installiere patch (2.7.6-8)...                                                                                                                                                           [6/8]
Installiere fakeroot (1.26-1)...                                                                                                                                                         [7/8]
Installiere bison (3.8.2-1)...                                                                                                                                                           [8/8]
Starte Post-Transaction-Hooks...
Arming ConditionNeedsUpdate...                                                                                                                                                           [1/2]
Updating the info directory file...                                                                                                                                                      [2/2]

Erstelle pdfsam...
Running as unit: run-u131.service
Press ^] three times within 1s to disconnect TTY.
==> Erstelle Paket: pdfsam 4.2.8-1 (So 05 Dez 2021 10:56:28 CET)
==> Prüfe Laufzeit-Abhängigkeiten...
==> Prüfe Buildtime-Abhängigkeiten...
==> Empfange Quellen...
  -> pdfsam-4.2.8-linux.tar.gz gefunden
  -> pdfsam gefunden
==> Überprüfe source Dateien mit sha512sums...
    pdfsam-4.2.8-linux.tar.gz ... Erfolg
    pdfsam ... Erfolg
==> Entferne existierendes $srcdir/ Verzeichnis...
==> Entpacke Quellen...
==> Beginne prepare()...
[pdfsam]                          Generating desktop file... ok
==> Betrete fakeroot Umgebung...
==> Beginne package()...
==> Säubere Installation...
  -> Entferne libtool Dateien...
  -> Bereinige ungewollte Dateien...
  -> Entferne statische Bibliotheken...
  -> Entferne unnötige Symbole aus Binär-Dateien und Bibliotheken...
  -> Komprimiere Man-Pages und Info-Seiten...
==> Prüfe auf Paketierungsprobleme...
==> Erstelle Paket "pdfsam"...
  -> Erstelle .PKGINFO Datei...
  -> Erstelle .BUILDINFO Datei...
  -> Erstelle .MTREE-Datei...
  -> Komprimiere Paket... 
==> Verlasse fakeroot Umgebung.
==> Beendete Erstellung: pdfsam 4.2.8-1 (So 05 Dez 2021 10:56:30 CET)
==> Räume auf...
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 2.953s
CPU time consumed: 3.213s
Running as unit: run-u132.service
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 568ms
CPU time consumed: 651ms

Überprüfe Schlüsselring...                                                                                                                                                               [1/1]
Integrität wird überprüft...                                                                                                                                                             [1/1]
Paketdateien werden geladen...                                                                                                                                                           [1/1]
Dateikonflikte werden überprüft...                                                                                                                                                       [1/1]
Überprüfe verfügbaren Speicherplatz...                                                                                                                                                   [1/1]
Installiere pdfsam (4.2.8-1)...                                                                                                                                                          [1/1]
Starte Post-Transaction-Hooks...
Arming ConditionNeedsUpdate...                                                                                                                                                           [1/3]
Updating icon theme caches...                                                                                                                                                            [2/3]
Updating the desktop file MIME type cache...                                                                                                                                             [3/3]
Vorgang erfolgreich abgeschlossen.

To me it looks like the java you have installed and set as default is the wrong version.

The package needs (and was built) against version 11 or greater.
The PKGBUILD states:

depends=('hicolor-icon-theme' 'java-environment>=11' 'sh')

The one you have set as your current default may be a lesser version.

Java - ArchWiki

I’m not sure whether Manjaro has got it’s own tool to do that, to manage multiple java versions.

You may need to set version 11 or higher as default
or otherwise ensure that pdfsam uses this version.

… that is what it looks like to me …

Addition a few hours later:
on the github page

GitHub - torakiki/pdfsam: PDFsam, a desktop application to extract pages, split, merge, mix and rotate PDF files

it says, in “Requirements”:

PDFsam Basic is written using JavaFX. Version 4 is released as a self-contained application and includes a jlinked OpenJDK 11 runtime

So everything needed to run it is there - but somehow it seems to interfere with whatever java is installed already …

I don’t know and cannot help.

Tip:
if you post in english
make sure the program output is also in english
prepend:

LANG=C before your command, like:

LANG=C pamac build --no-clone pdfsam

so all the output will be in english …

Check the JDK/JRE requirements of pdfsam and install the right one. That error occurs when your JVM doesn’t understand the binary (the Java bytecode).

Thank you for the pointer to Java - ArchWiki. Indeed I can see and change:

[achat ~]# archlinux-java status
Available Java environments:
  java-17-openjdk
  java-8-openjdk (default)

[achat ~]# archlinux-java set java-17-openjdk

[achat ~]# archlinux-java status
Available Java environments:
  java-17-openjdk (default)
  java-8-openjdk
[achat ~]#

After that change I can start pdfsam.

Remaining Question:
will it become necessary to switch back to java-8-openjdk (default)? Under which circumstances?

I don’t know.

In case one of your programs does require a lesser version such as java-8-openjdk
and will not function properly with a more recent one.

With
archlinux-java
you set the default java that is used.

It is still possible
without changing the default set through archlinux-java
to start a program and tell it to use another installed version by providing the correct $PATH to it
like
archlinux-java
helps you to do when you use it to select a default.