如何解决“图形设备初始化失败:d3d,sw"问题 [英] How to solve the "Graphics Device initialization failed for : d3d, sw" Problem

查看:445
本文介绍了如何解决“图形设备初始化失败:d3d,sw"问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在启动使用 JavaFX 11+ 的应用程序时遇到以下 RuntimeException:

I encountered the following RuntimeException when starting an application which uses JavaFX 11+:

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:280)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243)
    at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
    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 java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
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:94)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
    at java.base/java.lang.Thread.run(Thread.java:835)
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 java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: No toolkit found
    at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
    ... 5 more

推荐答案

下载JavaFX 11+后,解压文件,解压后切换到IntelliJ IDEA.然后在 IntelliJ IDEA 中按照以下步骤操作.

After downloading JavaFX 11+, extract the file, and when the file is extracted, switch to IntelliJ IDEA. Then follow the steps below in IntelliJ IDEA.

  1. 文件
  2. 项目结构
  3. 全球图书馆
  4. 按+"号,然后按 Java
  5. 转到您刚刚下载的 JavaFX 11+ 文件夹.进入文件夹,现在进入lib"并选择文件夹中除src.zip"之外的所有文件,然后按右下角的确定"并将其另存为javafx12".
  6. 现在您将鼠标指针移到+"下方,然后在您命名为javafx12"的库上右键单击,现在会打开一个带有不同选项的小窗口,但是您将鼠标指针按在添加到"上Modules"之后,您将鼠标指针移动到src"文件夹并用鼠标右键单击.现在打开一个带有各种选项的宽窗口,但您选择了新建"选项,现在打开了一个带有许多不同选项的宽窗口,但您再次选择module-info.java",现在您复制此文本:

  1. File
  2. Project Structure
  3. Global Libraries
  4. Press the "+" sign and then Java
  5. Go to the JavaFX 11+ folder you have just downloaded. Go into the Folder and now go into "lib" and select all of these files in the Folder except "src.zip", and press "OK" in the bottom right corner and save it as "javafx12".
  6. Now you move the mouse pointer under the "+" and press right click on the Librarie that you named as "javafx12", now a small window opens with different options but you press the mouse pointer on "Add to Modules" after you did that you move the mouse pointer to the "src" Folder and right-click with the mouse. Now open a wide window with various options but you choose the "New" option, now has opened a wide window with many different options but you choose again "module-info.java" and now you copy this text:

module YOUR-PROJECT-NAME {

    requires javafx.graphics;
    requires javafx.controls;
    requires javafx.media;
    requires javafx.base;
    requires javafx.web;
    requires javafx.swing;
    requires javafx.fxml;

    opens application;
}

这解决了问题.

这篇关于如何解决“图形设备初始化失败:d3d,sw"问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆