首页 > 解决方案 > JavaFX Exported Runnable JAR Error, Error initializing QuantumRenderer, No toolkit found

问题描述

I'm building my final high school project and I'm using JavaFX for the first time. I really like it and it works fine in Eclipse IDE but when I exported my application I came to a problem. The runnable .jar is crashing. I was browsing about the problem and none of the solutions worked. Also I saw only few with the same command line output but no adequate solutions. Does anybody know how to fix this? Thank You.

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 javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
        at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:264)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        at java.base/java.lang.Thread.run(Thread.java:831)
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:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: No toolkit found
        at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:276)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
        ... 5 more

Update: By creating new main class and launching JavaFX Application main method from there I got this:

WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @2a8d14d8'
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:283)
        at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:264)
        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.base/java.lang.Thread.run(Thread.java:831)
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)
        ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:276)
        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.base/java.lang.Thread.run(Thread.java:831)

标签: javajavafxjarexecutable-jarjavafx-17

解决方案


推荐阅读