Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After installing JDK, unable to run .jar

During a course it was installed JDK on my computer in order to be able to run eXist database. After this, after executing the command java -jar fileName.jar I get the following error.

Graphics Device initialization failed for : d3d, 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:222) 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 com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) 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) ... 1 more Exception in thread "main" java.lang.RuntimeException: No toolkit found at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:835)

Windows 10

java -version

openjdk version "12.0.2" 2019-07-16 OpenJDK Runtime Environment Adopt

OpenJDK (build 12.0.2+10) OpenJDK 64-Bit Server VM Adopt

OpenJDK (build 12.0.2+10, mixed mode, sharing)

like image 495
o-sapov Avatar asked Sep 09 '19 15:09

o-sapov


People also ask

Why can't I run jar files with Java?

If you do not have Java installed, and the PATH variable is not set correctly, attempts to run a JAR file on Windows or Ubuntu will result in a 'Java not recognized' error. To run a JAR file, you must install the Java JDK or JRE on your computer.

How do I open a JAR file with JDK?

Right-click on the JAR file. Go to “Open With Other Applications”. Select Show other applications. Select Open With OpenJDK Java X Runtime.

Do you need JDK to run jar files?

To run a jar file you only need java.exe(windows). JDK is the development kit for Java and JRE is the runtime. JDK contains JRE.


1 Answers

From your log its clear that you'r using JDK-12, and it seems that your jar is developed with JDK-8 where this version of JDK contains the JavaFx library.

But Oracle is removing JavaFX from the JDK-11, so it is no longer present in the JDK-11+, instead you have two solutions :

  1. use JDK-8 which contains this JavaFx,
  2. or include the JavaFx package or dependency in your project check the link
like image 183
YCF_L Avatar answered Sep 25 '22 02:09

YCF_L