Jfoenix: Cannot import com.jfoenix.controls.*

Created on 14 Mar 2016  路  3Comments  路  Source: sshahine/JFoenix

IntelliJ returns that it cannot import class or package at line
<?import com.jfoenix.controls.*?>

Compiling a simple code returns

/usr/java/default/bin/java -Didea.launcher.port=7533 -Didea.launcher.bin.path=/opt/intellij-idea-ultimate/bin -Dfile.encoding=UTF-8 -classpath /usr/java/jdk1.8.0_74/jre/lib/jfxswt.jar:/usr/java/jdk1.8.0_74/jre/lib/javaws.jar:/usr/java/jdk1.8.0_74/jre/lib/jce.jar:/usr/java/jdk1.8.0_74/jre/lib/charsets.jar:/usr/java/jdk1.8.0_74/jre/lib/rt.jar:/usr/java/jdk1.8.0_74/jre/lib/plugin.jar:/usr/java/jdk1.8.0_74/jre/lib/jfr.jar:/usr/java/jdk1.8.0_74/jre/lib/deploy.jar:/usr/java/jdk1.8.0_74/jre/lib/management-agent.jar:/usr/java/jdk1.8.0_74/jre/lib/resources.jar:/usr/java/jdk1.8.0_74/jre/lib/jsse.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/zipfs.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/jaccess.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/localedata.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/dnsns.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/sunec.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/nashorn.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/jfxrt.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/cldrdata.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/sunpkcs11.jar:/usr/java/jdk1.8.0_74/jre/lib/ext/sunjce_provider.jar:/home/michael/important/projects/assignments/graphics_2/out/production/graphics_2:/opt/intellij-idea-ultimate/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain main.Main
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException: JFXButton is not a valid type.
/home/michael/important/projects/assignments/graphics_2/out/production/graphics_2/main/main.fxml:36

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2597)
    at javafx.fxml.FXMLLoader.createElement(FXMLLoader.java:2774)
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2704)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
    at main.Main.start(Main.java:13)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)
    ... 1 more

Process finished with exit code 1

The demo runs fine, and regular JavaFX projects run fine. My team mate also got the same issue on his machine.

Most helpful comment

i believe that jfoenix.jar is not included in the project build path. Make sure it's included in your build path.

All 3 comments

i believe that jfoenix.jar is not included in the project build path. Make sure it's included in your build path.

yup, worked great, thanks!

how can i set up build path in ecplise that have module path and class path.
thank u!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rfenters95 picture rfenters95  路  4Comments

caoyanfeng picture caoyanfeng  路  3Comments

riftshadow picture riftshadow  路  4Comments

rickyzhangca picture rickyzhangca  路  4Comments

SkaaRJik picture SkaaRJik  路  4Comments