JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

Problem Caused by: java.lang.ClassNotFoundException: com.jfoenix.controls.JFXButton

Open babanaweed opened this issue 5 years ago • 9 comments

I added JFoenix to IntelliJ and SceneBuilder. It works in SceneBuilder but while compling the project leads to ClassNotFoundException

========================================================= Exception in Application start method java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051) Caused by: java.lang.RuntimeException: Exception in Application start method at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:835) Caused by: javafx.fxml.LoadException: /C:/Users/Sayedi/IdeaProjects/sceneBuilder/out/production/sceneBuilder/sample/sample.fxml

at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml/javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2863)
at javafx.fxml/javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2707)
at javafx.fxml/javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2676)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2542)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3237)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3194)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3163)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3136)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3113)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3106)
at sceneBuilder/sample.Main.start(Main.java:13)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
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)
... 1 more

Caused by: java.lang.ClassNotFoundException: com.jfoenix.controls.JFXButton at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at javafx.fxml/javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2931) at javafx.fxml/javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2920) at javafx.fxml/javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2861) ... 20 more Exception running application sample.Main

babanaweed avatar Mar 03 '20 10:03 babanaweed

i have the same problem

imadl3iii avatar Jul 18 '20 14:07 imadl3iii

Maybe there is a problem with the import of the jfoenix package, see if other jfx components can be loaded, or try to build it with maven

qxxiao avatar Jul 21 '20 05:07 qxxiao

i tried with others jfx components and it doesn't work. i can't found any solution on the internet, the jfoenix jar is imported in the project and i use javaSE-10 jre-10.0.2

imadl3iii avatar Jul 21 '20 15:07 imadl3iii

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 19 '21 00:01 stale[bot]

Hi developers I get this error when I try make .exe from .jar file bu usnig luanch4j tool. I am use javaFX so I need import Jfoenix library for more awesome look interface please can anney one help me

Caused by: java.lang.ClassNotFoundException: com.jfoenix.controls.JFXDatePicker at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2916) at javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2905) at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2846) ... 20 more

ZebdaYacine avatar May 14 '21 10:05 ZebdaYacine

Same problem :(

badr324 avatar Mar 12 '22 19:03 badr324

So,hvae somebody to give some advices to solve it?

chefqing avatar Apr 14 '22 15:04 chefqing

for those who use eclipse and who import jfoenix.jar in scene builder , and faced this problem , you just need to import jfoenix.jar in eclipse as External archive to the build path. .

mo3mida avatar Apr 20 '22 17:04 mo3mida

same problem

2017517110 avatar May 19 '23 12:05 2017517110