Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何修复使用jfoenix触发的错误?_Java_Eclipse_Javafx_Scenebuilder_Jfoenix - Fatal编程技术网

Java 如何修复使用jfoenix触发的错误?

Java 如何修复使用jfoenix触发的错误?,java,eclipse,javafx,scenebuilder,jfoenix,Java,Eclipse,Javafx,Scenebuilder,Jfoenix,我将JFoenix添加到eclipse和SceneBuilder中。 它在SceneBuilder中工作,但在完成项目时会导致ClassNotFoundException javafx.fxml.LoadException: /C:/Users/Dell/eclipse-workspace/WDP-solver/bin/application/Sample.fxml at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unkn

我将JFoenix添加到eclipse和SceneBuilder中。 它在SceneBuilder中工作,但在完成项目时会导致ClassNotFoundException

javafx.fxml.LoadException: /C:/Users/Dell/eclipse-workspace/WDP-solver/bin/application/Sample.fxml
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.importClass(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processImport(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processProcessingInstruction(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at application.Main.start(Main.java:13)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.jfoenix.controls.JFXButton
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadTypeForPackage(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadType(Unknown Source)
... 21 more

scenebuilder
能够找到
jphoenix
库,但是您的项目/您编写的java代码找不到jphoenix库。这就是为什么您会得到
ClassNotFoundException
。所以要解决这个问题,必须在项目中导入jar文件。我自己不使用eclipse,所以我自己也不知道如何做到这一点。一个快速的谷歌揭示了这个答案:

根据这一点,
您可以通过右键单击项目在Eclipse中添加一个jar→ 构建路径→ 配置生成路径。在“库”选项卡下,单击“添加Jar”或“添加外部Jar”并提供Jar。

也许这会有帮助。一旦导入,您的项目应该正确编译。祝你好运。

在我的例子中,jar也是在eclipse上导入的!!这就是问题所在