Following error occurs when using AdoptOpenJDK and OpenJFX. “Error initializing QuantumRenderer: no suitable pipeline found”

不打扰是莪最后的温柔 提交于 2021-02-07 18:37:41

问题


I am using IntelliJ, Gradle, AdoptOpenJDK 12 and OpenJFX for my project. I am trying creating a simple HelloWorld kind of program to get started with OpenJFX. My project runs fine with OracleJDK but the moment I switch to AdoptOpenJDK 12 and run the project I get the following error in the console:

Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found

Caused by: java.lang.RuntimeException: No toolkit found

I have tried switching to IBM JDK and had no luck with that either.

4:21:13 PM: Executing task 'run'...

Gradle Daemon started in 2 s 311 ms
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE

> Task :run FAILED
Loading library prism_d3d from resource failed: java.lang.UnsatisfiedLinkError: C:\Users\Kula\.openjfx\cache\11.0.2\prism_d3d.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
java.lang.UnsatisfiedLinkError: C:\Users\Kula\.openjfx\cache\11.0.2\prism_d3d.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
                at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
                at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
                at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
                at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
                at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
                at java.base/java.lang.Runtime.load0(Runtime.java:767)
                at java.base/java.lang.System.load(System.java:1831)
                at javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:205)
                at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:185)
                at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:157)
                at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:52)
                at javafx.graphics/com.sun.prism.d3d.D3DPipeline.lambda$static$0(D3DPipeline.java:48)
                at java.base/java.security.AccessController.doPrivileged(Native Method)
                at javafx.graphics/com.sun.prism.d3d.D3DPipeline.<clinit>(D3DPipeline.java:44)
                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)
Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: C:\Users\Kula\.openjfx\cache\11.0.2\prism_sw.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
java.lang.UnsatisfiedLinkError: C:\Users\Kula\.openjfx\cache\11.0.2\prism_sw.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
                at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
                at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
                at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
                at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
                at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
                at java.base/java.lang.Runtime.load0(Runtime.java:767)
                at java.base/java.lang.System.load(System.java:1831)
                at javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:205)
                at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:185)
                at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:157)
                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 :  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: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

回答1:


I ran into similar issue and root cause was that I installed

OpenJDK12U-jdk_x86-32_windows_hotspot_12.0.2_10.msi

instead of correct verions which is

OpenJDK12U-jdk_x64_windows_hotspot_12.0.2_10.msi

Solutions resolution

  1. Make sure to get the right version of from

https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/tag/jdk-12.0.2%2B10

  1. If you are using gradle. Then in your gradle.properties file point to the right version of the JDK as

org.gradle.java.home=C:/Program Files/AdoptOpenJDK/jdk-12.0.2.10-hotspot



来源:https://stackoverflow.com/questions/57909379/following-error-occurs-when-using-adoptopenjdk-and-openjfx-error-initializing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!