从cmd returna运行.jar文件'错误初始化量子量机:找不到合适的管道。错误

发布于 2025-02-06 14:23:26 字数 5643 浏览 1 评论 0原文

我有一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨的味道风的声音 2025-02-13 14:23:27

我通过将所有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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文