线程“JavaFX Application Thread”中的异常java.lang.NoClassDefFoundError:javafx / scene / control / ButtonBar

问题描述 投票:0回答:1

我是JavaFx的新手,我了解到我可以使用controlsfx创建通知。但是,在包含并运行通知代码之后,我得到了一个未找到类的异常,我不知道如何处理它,因为我在研究时没有得到任何网络帮助。我使用的是JDK jdk1.8.0_20,Netbeans 8.0.2和controlsfx 8.40.14。以下是我创建通知的代码

Platform.runLater(() -> { 
    Notifications notifications = Notifications.create().title("Verification successful").text("User has been verified").graphic(null).hideAfter(Duration.seconds(2)).position(Pos.TOP_RIGHT);
                                                                    notifications.show();
});

这是个例外

Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: javafx/scene/control/ButtonBar
    at org.controlsfx.control.Notifications$NotificationPopupHandler.show(Notifications.java:349)
    at org.controlsfx.control.Notifications$NotificationPopupHandler.show(Notifications.java:322)
    at org.controlsfx.control.Notifications.show(Notifications.java:269)
    at flock.express.VerificationController.lambda$ProcessCaptureResult$0(VerificationController.java:263)
    at flock.express.VerificationController$$Lambda$304/1685872131.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
    at com.sun.javafx.application.PlatformImpl$$Lambda$47/873652227.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
    at com.sun.javafx.application.PlatformImpl$$Lambda$46/501263526.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
    at com.sun.glass.ui.win.WinApplication$$Lambda$37/96639997.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: javafx.scene.control.ButtonBar
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 15 more
java javafx fxml classnotfoundexception controlsfx
1个回答
0
投票

我下载了jdk1.8.0_181,因为我使用Netbeans,我在Netbeans.conf文件中更改了netbeans_jdkhome以使用它,现在工作正常

© www.soinside.com 2019 - 2024. All rights reserved.