How to solve "Graphics Device initialization failed for : d3d, sw" when running a java Jar file with JavaFx

Patty23 :

Good Afternoon everyone.

I'm having a problem when I try to run my Java Code as a Runnable Jar file. I'm using Eclipse and I created a normal Java Project. I included the JavaFX jars as a User Libary. The Program runs without a problem when I start it with the IDE. To create the Jar file I use the the build in Export of a Java Project in the Runnable Jar file. When I check "Extract required libaries into generated JAR" and run it, I get this Error Message:

Error: JavaFX runtime components are missing, and are required to run this application

When I check "Package required libaries into generated JAR" and run it, I get this Error Message:

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:244)
        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.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
Caused by: 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)

Does anyone know, why I cannot run the JAR but in the IDE it runs normally?

I installed JavaFX following the Documentation here https://openjfx.io/openjfx-docs/ .

Patty23 :

I found a solution to my Problem. When I Export the Libaries into the Generated Jar I got the Error that the JavaFX Runtime components are missing. I now remembered that I got the same Error in Eclipse before although there was no Error in the Code and I used JavaFX elements. But to get it up and running I had to add VM Arguments. So I only had to write this in the command promt when I wanted to run the program.

Assuming you already are in the directory of your build Jar file:

java --module-path "C:\Path\to\javafx-sdk-13.0.2\lib" --add-modules javafx.controls,javafx.fxml -jar YourJar.jar

It's working now for me. Hope it will help others too.

Best Wishes

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to open JavaFX .jar file with JDK 11?

From Java

Java - How to replace a running jar file

From Java

Running a JAR file without directly calling `java`

From Java

How to set the -Xmx when start running a jar file?

From Java

include external jar when running java -jar

From Java

NoClassDefFoundError when running Scala jar file

From Java

How to re-run the user interface written with javafx in system tray when java jar application is running

From Java

How to solve the "Graphics Device initialization failed for : d3d, sw" Problem

From Dev

How to call an XML file when Java jar file is excuted

From Dev

invalid file (bad magic number):how I could solve this when I execute JAR file not works using this java code?

From Dev

.jar not running when passed valid file in args

From Dev

How to get unix process ID when running java -jar command

From Dev

how to solve this error when running flask with pypy?

From Dev

How to access file in a JAR when running a Maven build

From Dev

Issue with main when running jar file

From Dev

javafx resource cannot be loaded when running from jar

From Dev

How do I easily elevate when running a .jar file?

From Dev

Test if application is running in a jar file in Java

From Dev

How to solve java.lang.NoClassDefFoundError when creating bat file?

From Dev

NoSuchFileException when running jar file

From Dev

Java properties file in jar not found when running jar

From Dev

Java jar file not running

From Dev

Jar file not working (filenotfoundexception when running in cmd)

From Dev

Java problem - java, Jar file Statmetrics is not running

From Dev

How to see Java executable jar file now running and stop jar file from GUI or notification window?

From Dev

JavaFX runtime exceptions when running .jar file

From Dev

Error creating bean when running .JAR file

From Dev

Unable to Access Jar File When Running Akka

From Dev

Database not updating when running from .jar file

Related Related

  1. 1

    How to open JavaFX .jar file with JDK 11?

  2. 2

    Java - How to replace a running jar file

  3. 3

    Running a JAR file without directly calling `java`

  4. 4

    How to set the -Xmx when start running a jar file?

  5. 5

    include external jar when running java -jar

  6. 6

    NoClassDefFoundError when running Scala jar file

  7. 7

    How to re-run the user interface written with javafx in system tray when java jar application is running

  8. 8

    How to solve the "Graphics Device initialization failed for : d3d, sw" Problem

  9. 9

    How to call an XML file when Java jar file is excuted

  10. 10

    invalid file (bad magic number):how I could solve this when I execute JAR file not works using this java code?

  11. 11

    .jar not running when passed valid file in args

  12. 12

    How to get unix process ID when running java -jar command

  13. 13

    how to solve this error when running flask with pypy?

  14. 14

    How to access file in a JAR when running a Maven build

  15. 15

    Issue with main when running jar file

  16. 16

    javafx resource cannot be loaded when running from jar

  17. 17

    How do I easily elevate when running a .jar file?

  18. 18

    Test if application is running in a jar file in Java

  19. 19

    How to solve java.lang.NoClassDefFoundError when creating bat file?

  20. 20

    NoSuchFileException when running jar file

  21. 21

    Java properties file in jar not found when running jar

  22. 22

    Java jar file not running

  23. 23

    Jar file not working (filenotfoundexception when running in cmd)

  24. 24

    Java problem - java, Jar file Statmetrics is not running

  25. 25

    How to see Java executable jar file now running and stop jar file from GUI or notification window?

  26. 26

    JavaFX runtime exceptions when running .jar file

  27. 27

    Error creating bean when running .JAR file

  28. 28

    Unable to Access Jar File When Running Akka

  29. 29

    Database not updating when running from .jar file

HotTag

Archive