Exception in thread “WindowsNativeRunloopThread”

问题描述

JavaFX maven项目在idea中启动报错:

Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError: <init>
	at javafx.graphics/com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method)
	at javafx.graphics/com.sun.glass.ui.Screen.initScreens(Screen.java:412)
	at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Application.java:152)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
	at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
	at javafx.graphics/com.sun.prism.d3d.D3DPipeline.getAdapterOrdinal(D3DPipeline.java:205)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.assignScreensAdapters(QuantumToolkit.java:695)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:313)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:258)
	at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Application.java:153)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
	at java.base/java.lang.Thread.run(Thread.java:834)

解决办法

在VM参数中添加以下配置:

-Djava.library.path=C:/
idea 启动类VM参数配置
idea 启动类VM参数配置

原创文章,作者:506227337,如若转载,请注明出处:https://blog.ytso.com/243826.html

(0)
上一篇 2022年4月11日
下一篇 2022年4月11日

相关推荐

发表回复

登录后才能评论