起初我得到了缺少 JavaFX 运行时组件的错误,这导致我进入了这个线程。在该线程中应用解决方案后,即创建一个不扩展 Application 的不同 Main 类,我收到一条新的错误消息,下面是 -Dprism.verbose=true 的完整堆栈跟踪:Prism pipeline init order: d3d swUsing Double Precision Marlin RasterizerUsing dirty region optimizationsNot using texture mask for primitivesNot forcing power of 2 sizes for texturesUsing hardware CLAMP_TO_ZERO modeOpting in for HiDPI pixel scalingPrism pipeline name = com.sun.prism.d3d.D3DPipelineGraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipelinejava.lang.ClassNotFoundException: com.sun.prism.d3d.D3DPipeline at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91) at 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 pipelinePrism pipeline name = com.sun.prism.sw.SWPipelineGraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipelinejava.lang.ClassNotFoundException: com.sun.prism.sw.SWPipeline我尝试了不同的 JDK 11 版本,但它们都提供了相同的错误消息
1 回答
largeQ
TA贡献2039条经验 获得超7个赞
我设法解决了我的问题。原因是我有
<minimizeJar>true</minimizeJar>
在 Maven Shade 插件中,它会自动从 jar 中删除 javafx-graphics。我通过添加一个显式过滤器来包含所有 openjfx 依赖项来解决它,即添加
<filter>
<artifact>org.openjfx</artifact>
<includes>
<include>**</include>
</includes>
</filter>
到插件的配置
添加回答
举报
0/150
提交
取消