在Windows上运行JavaFX应用程序时出错

时间:2019-09-10 10:24:35

标签: java windows javafx openjfx

我正在尝试使用OpenJDK / OpenJFX运行JavaFX应用程序, 这是一个基于OracleJDK / JavaFX的现有工作应用程序,我们希望将其迁移到OpenJFX。

我按照OpenJFX文档中有关如何构建胖子的说明进行操作,并且使用了以下版本:

  • OpenJDK 10
  • OpenJFX 11

我成功地构建了一个胖jar,其中包含所有.class文件和库。

在Windows 10上,我可以构建和运行OpenJFX HelloWorld应用程序。但是,在运行自己的应用程序时,出现关于无法加载的各种股票着色器的错误:

java.lang.InternalError:加载股票着色器Solid_Color时出错

Stacktrace:

day      oct      nov      dec 
5        2        0        2
6        0        2        1

我遵循了从类似问题中增加VRAM的建议: JavaFX on Raspberry PI: Error loading stock shader

这没有帮助。

还阅读了另一个类似的问题: How to recompile JavaFX 11/12

试图在各种Windows安装上运行该应用程序,同样的问题。

它们似乎是由以下代码引起的:

java.lang.InternalError: Error loading stock shader Solid_Color
        at com.sun.prism.d3d.D3DResourceFactory.createStockShader(D3DResourceFactory.java:411)
        at com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:263)
        at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:484)
        at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:355)
        at com.sun.prism.impl.ps.BaseShaderGraphics.fillQuad(BaseShaderGraphics.java:1613)
        at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:475)
        at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:328)
        at com.sun.javafx.tk.quantum.UploadingPainter.run(UploadingPainter.java:142)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        at java.base/java.lang.Thread.run(Thread.java:844)
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:564)
        at com.sun.prism.d3d.D3DResourceFactory.createStockShader(D3DResourceFactory.java:408)
        at com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:263)
        at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:484)
        at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:355)
        at com.sun.prism.impl.ps.BaseShaderGraphics.fillQuad(BaseShaderGraphics.java:1613)
        at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:475)
        at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:328)
        at com.sun.javafx.tk.quantum.UploadingPainter.run(UploadingPainter.java:142)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.RuntimeException: InputStream must be non-null
        at com.sun.prism.d3d.D3DResourceFactory.getBuffer(D3DResourceFactory.java:349)
        at com.sun.prism.d3d.D3DResourceFactory.createShader(D3DResourceFactory.java:390)
        at com.sun.prism.shader.Solid_Color_Loader.loadShader(Solid_Color_Loader.java:47)
        ... 19 more

一直很好。

我想念什么?

0 个答案:

没有答案