1

I am getting an odd error when I try to run a program that I'm trying to bring to Linux. I am able to compile/run without problems on Windows and OSX, but am seeing this problem on Ubuntu.

When I build/run/debug the program through Netbeans, everything is hunky dorey. It runs, all the tests in its suite complete, etc. When I try to run it independent of the IDE though, I run into the following problems:

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:280)
    at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at javafx.embed.swing.JFXPanel.lambda$initFx$1(JFXPanel.java:224)
    at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)

I have been banging my head against this for a few hours, and any thoughts/assistance would be much appreciated.

Draque Thompson
  • 908
  • 9
  • 16
  • What version of Java does your project use? What does executing `java -version` in a terminal window show? – VGR Jul 29 '19 at 20:32
  • I just upgraded to Java 12. At the console, it shows the version as: OpenJDK Runtime Environment (build 12.0.2+10) – Draque Thompson Jul 29 '19 at 23:34
  • did you add the modules from the command line? `java --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX` – trilogy Jul 30 '19 at 02:06
  • I have added these through the netbeans UI, in Properties->Libraries->Run->Modulepath – Draque Thompson Jul 30 '19 at 02:37
  • How, exactly, do you “run it independent of the IDE”? – VGR Jul 30 '19 at 02:39
  • Just at the terminal. What I’m saying is that I can debug and run through the IDE, but once my jar is built that I’m not able to run it from a terminal. – Draque Thompson Jul 30 '19 at 03:47
  • And what does your command line look like? Just `java -jar app.jar`? Are you using modules? – VGR Jul 30 '19 at 04:02
  • At the command line java -jar app.jar as you say. I’m using javafx, but importing libraries per OS, so I simply have that set up as a classpath and module path dependencies. – Draque Thompson Jul 30 '19 at 04:30
  • 1
    JavaFX is not a part of the Java 12 SDK, so how are you running a JavaFX application without specifying a classpath on the command line? How is your program able to load the JavaFX classes? – VGR Jul 30 '19 at 11:54
  • @DraqueThompson Yeah, that's not enough to put it in the IDE settings. You must specify the module-path and add them when you run it from command line. – trilogy Jul 30 '19 at 18:11
  • It appears JavaFX cannot find its native libraries. This can happen if you have moved or copied the .jar files out of the JavaFX SDK, or have combined them into a “fat jar.” The best solution is to leave the SDK’s files unaltered and place them in your classpath. Alternatively, you can add something like `-Djava.library.path=/opt/javafx-sdk-12/lib` to your command line. – VGR Aug 01 '19 at 11:58

1 Answers1

0

In my case, this problem occurs when I used oracle JDK and openJFX. When I switched to openJDK problem was solved (only on Ubuntu, Windows does not suffer from this problem).

If this will not help, you can try to change default gtk version for javaFX

-Djdk.gtk.version=2          //you can add as JVM option

The default version of GTK of javaFX was recently changed from gtk2 to gtk3. This fact causes many issues.

Ján Яabčan
  • 743
  • 2
  • 10
  • 20