我使用intellij构思创建了一个javafx桌面应用程序,并将其打包为this链接中给出的内容。它在我的电脑上工作正常,它有Windows 7.但是当在Windows 8.1上运行时,它会给出这个例外:
java.lang.NullPointerException
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedPgram(Un
known Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedRect(Unk
nown Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.fillRect(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.paintTiles(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.BaseNode.render(Unknown Source)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(Unknown Source)
at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(Unknown Source)
at com.sun.javafx.tk.quantum.PresentingPainter.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at com.sun.prism.render.RenderJob.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknow
n Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.sun.prism.impl.BaseResourceFactory.clearTextureCache(Unknown Sour
ce)
at com.sun.prism.impl.BaseResourceFactory.getCachedTexture(Unknown Sourc
e)
at com.sun.prism.impl.BaseResourceFactory.getCachedTexture(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(Unknown Sourc
e)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedPgram(Un
known Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedRect(Unk
nown Source)
at com.sun.prism.impl.ps.BaseShaderGraphics.fillRect(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.paintTiles(Unknown Source)
at com.sun.javafx.sg.prism.NGRegion.renderContent(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.prism.NGNode.doRender(Unknown Source)
at com.sun.javafx.sg.BaseNode.render(Unknown Source)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(Unknown Source)
at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(Unknown Source)
at com.sun.javafx.tk.quantum.PresentingPainter.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at com.sun.prism.render.RenderJob.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknow
n Source)
at java.lang.Thread.run(Unknown Source)
那么javafx在Windows 8上不起作用吗?我不认为它给那样的地方。毕竟它是一个典型的java应用程序,所以如果我们安装了jre它应该可以工作。
这可能是什么解决方案?
编辑:
这是一个奇怪的事情:
使用intellij idea 12.0.4构建的工件也可以在Windows 8上正常工作。但是当通过intellij构建时,13.0.1会给出错误。