-1

I added JFoenix to eclipse and SceneBuilder. It works in SceneBuilder but while compling the project leads to 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
user871611
  • 3,307
  • 7
  • 51
  • 73

1 Answers1

0

The scenebuilder is able to find the jphoenix library, but your project / the java codes that you wrote cannot find the jphoenix library. That is why you are getting the ClassNotFoundException. So to fix this, you have to import the jar file in your project. I don't use eclipse myself, so I myself don't know how to do this. A quick google revealed this answer:

how-to-import-a-jar-in-eclipse

According to this, You can add a jar in Eclipse by right-clicking on the Project → Build Path → Configure Build Path. Under Libraries tab, click Add Jars or Add External JARs and give the Jar. Maybe this will help. Once imported, your project should compile properly. Good luck.

Qazi Fahim Farhan
  • 2,066
  • 1
  • 14
  • 26