JavaFX,OS X,图形设备初始化失败:es2,sw

我试图在IntelliJ IDEA中创建JavaFX项目,但是每次都会出错。

完成教程https://openjfx.io/openjfx-docs/#IDE-

Intellij之后,我得到了:

Graphics Device initialization failed for :  es2, 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:222)

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:566)

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:834)

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:566)

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

Process finished with exit code 1

将-Dprism.verbose = true添加到IntelliJ IDEA中的VM选项之后(因此,我的VM选项如下所示:

--module-path /myPath/javafx-sdk-11.0.1/lib --add-modules=javafx.controls,javafx.fxml -Dprism.verbose=true

然后我得到以下输出:

Prism pipeline init order: es2 sw 

Using Double Precision Marlin Rasterizer

Using dirty region optimizations

Not using texture mask for primitives

Not forcing power of 2 sizes for textures

Using hardware CLAMP_TO_ZERO mode

Opting in for HiDPI pixel scaling

Prism pipeline name = com.sun.prism.es2.ES2Pipeline

Loading ES2 native library ... prism_es2

GraphicsPipeline.createPipeline failed for com.sun.prism.es2.ES2Pipeline

java.lang.UnsatisfiedLinkError: no prism_es2 in java.library.path: [/Users/Lisa/javafx-sdk-11.0.1/lib]

at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)

at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)

at java.base/java.lang.System.loadLibrary(System.java:1867)

at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:150)

at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:52)

at javafx.graphics/com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:68)

at java.base/java.security.AccessController.doPrivileged(Native Method)

at javafx.graphics/com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:50)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:315)

at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)

at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)

at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)

at java.base/java.lang.Thread.run(Thread.java:834)

*** Fallback to Prism SW pipeline

Prism pipeline name = com.sun.prism.sw.SWPipeline

GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline

java.lang.UnsatisfiedLinkError: no prism_sw in java.library.path: [/Users/Lisa/javafx-sdk-11.0.1/lib]

at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)

at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)

at java.base/java.lang.System.loadLibrary(System.java:1867)

at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:150)

at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:52)

at javafx.graphics/com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42)

at java.base/java.security.AccessController.doPrivileged(Native Method)

at javafx.graphics/com.sun.prism.sw.SWPipeline.<clinit>(SWPipeline.java:41)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:315)

at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)

at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)

at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)

at java.base/java.lang.Thread.run(Thread.java:834)

Graphics Device initialization failed for : es2, 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:222)

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:566)

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:834)

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:566)

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

Process finished with exit code 1

我应该怎么做才能使我的项目工作?

回答:

如 的文档中所述,从项目开始的第一步是:

下载 您的 ,并将其解压缩到所需位置。

将链接更改为新的特定于平台的已下载SDK的/lib文件夹后,为我解决了该问题,而我之前曾尝试使用其他用户提供的lib文件夹。

:在lib我们指定为的参数的文件夹中,SDK附带有捆绑的动态库modulepath。这些库是在平台上捆绑在一起的,因此跨平台使用的SDK或lib文件夹将无法提供动态库(如错误中提到的库)以在应用程序启动期间加载。

以上是 JavaFX,OS X,图形设备初始化失败:es2,sw 的全部内容, 来源链接: utcz.com/qa/411289.html

回到顶部