从cmd returna运行.jar文件'错误初始化量子量机:找不到合适的管道。错误
我有一个Javafx项目,在Intellij中运行良好,但是当我尝试创建.jar并运行它时,我得到了此错误:
Error: JavaFX runtime components are missing, and are required to run this application
所以我跑了,
Java -jar --module-path C:\"Program Files (x86)"\Java\javafx-sdk-18.0.1\lib --add-modules=javafx.controls,javafx.fxml,javafx.swing .\myJar.jar
这导致了这一点:
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 [email protected]/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
at [email protected]/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:266)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at [email protected]/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
at [email protected]/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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at [email protected]/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
at [email protected]/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.base/java.lang.Thread.run(Thread.java:833)
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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: No toolkit found
at [email protected]/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:278)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at [email protected]/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
... 5 more
I have a JavaFX project which runs perfectly well in IntelliJ, but when I tried to create a .jar and run it, I got this error:
Error: JavaFX runtime components are missing, and are required to run this application
So I ran
Java -jar --module-path C:\"Program Files (x86)"\Java\javafx-sdk-18.0.1\lib --add-modules=javafx.controls,javafx.fxml,javafx.swing .\myJar.jar
which resulted in this:
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 [email protected]/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
at [email protected]/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:266)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at [email protected]/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
at [email protected]/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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at [email protected]/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
at [email protected]/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.base/java.lang.Thread.run(Thread.java:833)
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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: No toolkit found
at [email protected]/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:278)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at [email protected]/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
... 5 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过将所有javafx .dll从
home/javafx-sdk/bin
复制到我的可执行文件。其他建议都没有起作用。我正在和Netbeans合作
I managed to make it work by copying all JavaFX .dlls from
home/JavaFX-SDK/bin
to where my executable .jar is. None of the other suggestions were working.I was working with Netbeans tho