JavaFX启动异常

0

错误日志:

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)

这个问题是由于我们系统环境变量配置的JDK版本低于JavaFX的版本。
比如项目JDK版本11、JavaFX版本11,但是环境变量配置的是JDK1.8。
这个和项目里面的配置没有关系。