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

查看:832
本文介绍了如何解决“图形设备初始化失败: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"的Librarie,现在将打开一个带有不同选项的小窗口,但您在添加至"上按了鼠标指针执行完模块"后,将鼠标指针移到"src"文件夹,然后用鼠标右键单击.现在打开带有各种选项的宽窗口,但是您选择"New"选项,现在已经打开了带有许多不同选项的宽窗口,但是您再次选择了"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天全站免登陆