beatngu13 / pdf-zoom-wizard

Lightweight and cross-platform tool for PDF bookmarks and links zoom settings
GNU General Public License v3.0
69 stars 4 forks source link

Graphics Device initialization failed for : es2, sw #357

Open gustavklopp opened 2 years ago

gustavklopp commented 2 years ago

Expected Behavior

Program opens without error

Actual Behavior

The program doesn't start: Error appears in the terminal:

$ ./pdfzoomwizard 
Oct 06, 2022 5:05:17 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6765b4e3'
Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
    at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:266)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
    at java.lang.Thread.run(Thread.java:833)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:597)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:194)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    ... 3 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:278)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
    at java.lang.Thread.run(Thread.java:833)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:597)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:194)

Steps to Reproduce

Run in the terminal: $ ./pdfzoomwizard I've tried to install java-openjfx since I've read elsewhere it could be the reason but nothing changed.

Environment

beatngu13 commented 2 years ago

Hi @gustavklopp,

Thanks for reporting!

First of all: I assume the PDF Zoom Wizard version 0.1.2 is a typo? What version are you using?

Both the native executables as well as the fat JAR bundle JavaFX, so installing java-openfx shouldn't be necessary. It looks you are using the native executable, so you shouldn't need Java at all.

Have you tried installing recent gtk2 (see "Error initializing QuantumRenderer: no suitable pipeline found")?

gustavklopp commented 2 years ago

Thanks for your reply! Sorry, it's the last version of course: 0.11.0!

Yes, I have already gtk2 installed:

$ pacman -Ss gtk2
...
extra/gtk2 2.24.33-2 [installed]
    GObject-based multi-platform GUI toolkit (legacy)
gustavklopp commented 1 year ago

I've tried to compile and run a one file javaFX program: https://openjfx.io/openjfx-docs/#install-javafx I've downloaded JavaFX library: the one noted "SDK", "Linux" and "x64": https://gluonhq.com/products/javafx/, and then:

$ export PATH_TO_FX=~/Downloads/javafx-sdk-19/lib

Then I can compile my simple helloword program using:

$ javac --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX.java

and run it with:

$ java --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX

And it works. I don't know exactly how it works for Java, but maybe the JavaFX SDK integrated into the executable Pdfzoomwizard for Linux isn't the good one?

beatngu13 commented 1 year ago

Hey @gustavklopp,

Thank you for the detailed feedback!

Would you mind trying out the fat JAR?

https://github.com/beatngu13/pdf-zoom-wizard/releases/download/v0.11.0/pdfzoomwizard-0.11.0.jar

Note that you need at least Java 17 installed. Then you can launch the app as follows:

$ java -jar pdfzoomwizard-0.11.0.jar

Wonder if that works?

gustavklopp commented 1 year ago

Yes, indeed, doing this launches the program! It displays a warning though :

$ java -jar pdfzoomwizard-0.11.0.jar 
Oct 21, 2022 7:02:50 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @50edd169'
07:02:51.558 [JavaFX Application Thread] INFO  Launcher - Launching PDF Zoom Wizard v0.11.0.

Besides I can also try building it on my system if you don't have linux yourself. I am more of a Python programmer so I would need guidance for that... (I have Eclipse Java already installed).