Exception in thread "WindowsNativeRunloopThread"

位置:首页>文章>详情   分类: 教程分享 > JavaFX教程   阅读(982)   2023-03-28 11:29:14

问题描述

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参数配置
标签: JavaFX idea maven java
地址:https://www.leftso.com/article/835.html

相关阅读

1.使用idea创建JavaFX项目idea创建JavaFX项目创建后运行尝试:运行结果 可以看到目前是能正常运行 Hello Word项目的,这个时候还没有maven支持
问题描述JavaFX maven项目在idea中启动报错:Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMet...
问题描述idea启动maven的JavaFX项目报错:Exception in Application start method java.lang.reflect.InvocationTarg...
最近在学习JavaFX,发现资料很少,连基本的图片读取都很多错误版本
问题描述最近写JavaFX程序遇到了下面的错误:Exception in thread "pool-2-thread-1" java.lang.IllegalStateException: No...