pdfsam crashes at launch on Bionic Beaver 18.04 LTS

Bug #1768565 reported by Jan Morten Schrag on 2018-05-02
50
This bug affects 11 people
Affects Status Importance Assigned to Milestone
openjdk-11 (Ubuntu)
Undecided
Unassigned
pdfsam (Ubuntu)
Undecided
Unassigned

Bug Description

Steps to reproduce:
1. Have Ubuntu 18.04 LTS installed (desktop really does not matter, but tested on MATE, LXDE and GNOME)
2. Install PDFSaM with `sudo apt-get install pdfsam`
3. Try to launch it from terminal with `pdfsam`

Expected results:
* PDFSaM launches normally

Actual results:
* PDFSaM crashes with the following messages in the termina:

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

Note: problem also seen on AskUbuntu ( https://askubuntu.com/q/1057210/66509 ).

Looks like the issue is known on github.

This comment contains a workaround:
https://github.com/torakiki/pdfsam/issues/220#issuecomment-386129933

Has to do with the default java version being used. pdfsam expects 8 but default is 11.

no longer affects: ubuntu-mate
Changed in pdfsam (Ubuntu):
status: New → Confirmed
tags: added: bionic
Norbert (nrbrtx) on 2018-07-18
summary: - pdfsam crashes at launch (MATE 18.04)
+ pdfsam crashes at launch on Bionic Beaver 18.04 LTS
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-11 (Ubuntu):
status: New → Confirmed
Norbert (nrbrtx) on 2018-07-18
description: updated
Shaiju Paul (shaiju83) wrote :

type in terminal : sudo update-alternatives --config java
and select java-8 by default (instead of java-9 or above )

Shaiju Paul (shaiju83) wrote :

Install qpdf using terminal : apt-get install qpdf

Use it this way to extract pages 1-10 from input.pdf and save it as output.pdf.

Examples :

qpdf --pages input.pdf 1-10 -- input.pdf output.pdf

or

qpdf --pages 4033931_UGC-Regulation_min_Qualification_Jul2018.pdf 57-111 -- 4033931_UGC-Regulation_min_Qualification_Jul2018.pdf UGC-Regulations-July2018.pdf

Jyoti (jyotik) wrote :

The bug is fixed in Ubuntu 18.04 (Bionic Beaver 64 bit) once the default java version is set to java-8.
No need to downgrade or uninstall java-10 or java-11. The default java is java-11 for Ubuntu 18.04.
PDFSAM basic 3.35 or 3.37 is written in java-8 and will work with java-8 only.

Tested on PDFSAM Split and Merge Basic Edition 3.3.5
OpenJDK Runtime Environment 1.8.0_181-8u181-b13-1ubuntu0.18.04.1-b13

Run in terminal
sudo update-alternatives --config java

Select/type 2 (or whatever serial number is shown against java-8). The press Enter to set the default java version to java-8.

Laurent Dinclaux (dreadlox) wrote :

Damn it doesn't work for me:

~ » java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.18.10.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

~ » /opt/pdfsam-basic/bin/pdfsam-basic
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/scene/layout/HBox

Maraschin (carlo-maraschin) wrote :

I'm sorry but say that the bug is fixed if you change the default version of java is misleading.
Everyone is migrating to 11, we may have other software that is using/depending on 11 and we want to move on, java 8 is soon EOF.

Java 8 EOL (end-of-life) are:
- January 2019 for Oracle (commercial)
- December 2020 for Oracle (non-commercial)
- At Least September 2023 for AdoptOpenJDK

Jeroen (jeroenst) wrote :

I also can confirm that this bug is still not fixed:

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:802)
 at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
 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:583)
 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
 ... 10 more

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.