提问人:mumbert4 提问时间:11/9/2023 更新时间:11/9/2023 访问量:49
在 Windows 上运行但不在 Linux 上运行的 JavaFX 应用程序
JavaFX app running on windows but not in linux
问:
我使用 jaxafx 和 intellij 创建了一个应用程序,在 Windows 中工作正常,但是当我在 linux 中使用以下命令执行 jar 时:
java --module-path javafx-sdk-21.0.1/lib --add-modules javafx.controls,javafx.fxml -jar ./i-ViSta4bike2.jar
我收到此错误:
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 [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:263)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at [email protected]/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1135)
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:1583)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1135)
Caused by: java.lang.RuntimeException: No toolkit found
at [email protected]/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:275)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at [email protected]/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at [email protected]/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 2 more
我尝试了在互联网上能找到的一切,我只想在两个操作系统中运行我的应用程序。
答: 暂无答案
评论
--module-path /Users/my_user/.m2/repository/org/openjfx/javafx-base/17.0.2/javafx-base-17.0.2-mac-aarch64.jar:/Users/my_user/.m2/repository/org/openjfx/javafx-media/17.0.2/javafx-media-17.0.2-mac-aarch64.jar:/Users/my_user/.m2/repository/org/openjfx/javafx-graphics/17.0.2/javafx-graphics-17.0.2-mac-aarch64.jar
jlink