1

I have been trying to use Jfoenix for quite some time now on eclipse but it never seems to work. I would really appreciate if any one here could help me. My JDK is 12.02, SceneBuilder Version is 8.5.0, Eclipse 2019-12, java version 8 update 261 in addition to JFoenix 8.0.10. I have all the paths figured out it simply just doesn't run. I can run the application without the JFoenix Libraries but I need my application to be aesthetically pleasing. Here are the errors:

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: java.lang.NoClassDefFoundError: com/sun/javafx/css/converters/PaintConverter
    at com.jfoenix.controls.JFXTextField$StyleableProperties.<clinit>(JFXTextField.java:241)
    at com.jfoenix.controls.JFXTextField.<init>(JFXTextField.java:146)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:166)
    at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:404)
    at java.base/java.lang.Class.newInstance(Class.java:590)
    at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1019)
    at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:754)
    at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)
    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 application.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.sun.javafx.css.converters.PaintConverter
    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)
    ... 30 more
Exception running application application.Main
package application;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {
    @Override
    public void start(Stage primaryStage) {
        try {
            Parent root = FXMLLoader.load(getClass().getResource("/application/HomePage.fxml"));
            Scene scene = new Scene(root,1000,800);
            scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
            primaryStage.setScene(scene);
            primaryStage.show();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
    
    public static void main(String[] args) {
        launch(args);
    }
}

The code ^

<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXPasswordField?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.Group?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.effect.DropShadow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.text.Font?>

<StackPane xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controllers.HomePageLoginController">
   <children>
      <AnchorPane prefHeight="644.0" prefWidth="940.0" style="-fx-background-color: #8ED5FF;">
         <children>
            <AnchorPane layoutX="394.0" layoutY="7.0" prefHeight="630.0" prefWidth="529.0" style="-fx-background-color: #FFFF; -fx-background-radius: 10px;">
               <effect>
                  <DropShadow color="#0617b5" />
               </effect>
               <children>
                  <TabPane fx:id="tabPane" layoutX="1.0" layoutY="100.0" prefHeight="483.0" prefWidth="528.0" tabClosingPolicy="UNAVAILABLE">
                    <tabs>
                      <Tab fx:id="employeeTab" text="Employee">
                           <content>
                              <AnchorPane prefHeight="200.0" prefWidth="200.0">
                                 <children>
                                    <JFXTextField fx:id="employeeUsernameText" focusColor="#1357cf" labelFloat="true" layoutX="125.0" layoutY="138.0" prefHeight="31.0" prefWidth="304.0" promptText="Employee Username" unFocusColor="#4d4d4d">
                                       <font>
                                          <Font name="Constantia Bold" size="19.0" />
                                       </font>
                                    </JFXTextField>
                                    <JFXPasswordField fx:id="EmployeePasswordTab" focusColor="#1357cf" labelFloat="true" layoutX="126.0" layoutY="215.0" prefHeight="31.0" prefWidth="304.0" promptText="Employee Password">
                                       <font>
                                          <Font name="Constantia Bold" size="19.0" />
                                       </font>
                                    </JFXPasswordField>
                                    <Label alignment="CENTER" contentDisplay="CENTER" layoutX="21.0" layoutY="400.0" prefHeight="21.0" prefWidth="469.0" text="Welcome Label">
                                       <font>
                                          <Font name="Constantia Italic" size="15.0" />
                                       </font>
                                    </Label>
                                    <JFXButton fx:id="employeeLogin" layoutX="217.0" layoutY="303.0" style="-fx-background-color: #8ED5FF; -fx-background-radius: 10px;" text="Login">
                                       <font>
                                          <Font name="Constantia Bold" size="19.0" />
                                       </font>
                                    </JFXButton>
                                 </children>
                              </AnchorPane>
                           </content>
                        </Tab>
                      <Tab fx:id="tabClient" text="Client">
                           <content>
                              <AnchorPane prefHeight="432.0" prefWidth="528.0">
                                 <children>
                                    <JFXTextField fx:id="clientUsernameText" focusColor="#1357cf" labelFloat="true" layoutX="125.0" layoutY="138.0" prefHeight="31.0" prefWidth="304.0" promptText="Client Username" unFocusColor="#4d4d4d">
                                       <font>
                                          <Font name="Constantia Bold" size="19.0" />
                                       </font>
                                    </JFXTextField>
                                    <JFXPasswordField fx:id="clientPasswordText" focusColor="#1357cf" labelFloat="true" layoutX="126.0" layoutY="215.0" prefHeight="31.0" prefWidth="304.0" promptText="Client Password">
                                       <font>
                                          <Font name="Constantia Bold" size="19.0" />
                                       </font>
                                    </JFXPasswordField>
                                    <JFXButton fx:id="clientLoginButton" layoutX="224.0" layoutY="305.0" prefHeight="35.0" prefWidth="89.0" style="-fx-background-color: #8ED5FF; -fx-background-radius: 10px;" text="Login">
                                       <font>
                                          <Font name="Constantia Bold" size="18.0" />
                                       </font>
                                    </JFXButton>
                                    <Label alignment="CENTER" contentDisplay="CENTER" layoutX="21.0" layoutY="400.0" prefHeight="21.0" prefWidth="469.0" text="Welcome Label Client">
                                       <font>
                                          <Font name="Constantia Italic" size="15.0" />
                                       </font>
                                    </Label>
                                 </children>
                              </AnchorPane>
                           </content>
                        </Tab>
                    </tabs>
                  </TabPane>
                  <Group layoutX="68.0" layoutY="47.0">
                     <children>
                        <Pane fx:id="slidingPane" layoutX="6.0" layoutY="1.0" prefHeight="35.0" prefWidth="368.0">
                           <children>
                              <Label fx:id="employeeStatus" alignment="CENTER" onMouseClicked="#openEmployee" prefHeight="35.0" prefWidth="158.0" style="-fx-font-weight: 700;" text="EMPLOYEE" textAlignment="CENTER">
                                 <font>
                                    <Font name="System Bold" size="15.0" />
                                 </font>
                              </Label>
                              <Label fx:id="clientLabelStatus" alignment="CENTER" layoutX="174.0" layoutY="-1.0" onMouseClicked="#openClient" prefHeight="35.0" prefWidth="197.0" style="-fx-font-weight: 700;" text="CLIENT" textAlignment="CENTER">
                                 <font>
                                    <Font name="System Bold" size="15.0" />
                                 </font>
                              </Label>
                           </children>
                        </Pane>
                        <Label fx:id="labelStatus" alignment="CENTER" layoutY="1.0" prefHeight="37.0" prefWidth="167.0" style="-fx-background-color: #8ED5FF; -fx-background-radius: 10px;" text="EMPLOYEE">
                           <cursor>
                              <Cursor fx:constant="DEFAULT" />
                           </cursor>
                        </Label>
                     </children>
                  </Group>
               </children>
            </AnchorPane>
            <AnchorPane layoutX="41.0" layoutY="132.0">
               <children>
                  <ImageView fitHeight="353.0" fitWidth="414.0" layoutX="-25.0" layoutY="10.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../../../Downloads/imageedit_1_7896082891.png" />
                     </image>
                  </ImageView>
               </children>
               <effect>
                  <DropShadow color="WHITE" />
               </effect>
            </AnchorPane>
         </children>
      </AnchorPane>
   </children>
</StackPane>

The FXML doc ^ Please help

  • I think this problem is related to the java version used, try to see this answer (https://stackoverflow.com/questions/46754639/javafx-weird-classnotfoundexception-after-updating-to-java-9) and this link (https://github.com/jfoenixadmin/JFoenix/issues/523) – Amine ABBAOUI Aug 21 '20 at 08:19
  • I'm using version 8 is that the issue? No my java version seems fine from the documents you've linked – The_Sawalmeh Aug 21 '20 at 08:20
  • as shown in the second link : "If you're using Java 8, make sure you have version above 1.8.0_60" – Amine ABBAOUI Aug 21 '20 at 08:23
  • 1
    Yepp Im using 1.8.0_261 – The_Sawalmeh Aug 21 '20 at 08:24
  • You wrote in your question: _All my versions of Java, JavaFX, SceneBuilder and eclipse are up to date_ What does that mean? Are you using JDK 14.0.2, which is the latest public release? Are you using JavaFX 14, which is the latest version? Are you using ScenBuilder for Java 11? Are you using Eclipse 2020-06? And don't post images of the stack trace, post the actual text. Is taking a screen capture easier than doing a copy/paste? – Abra Aug 21 '20 at 08:28
  • My bad Abra, My JDK is 12.02, SceneBuilder Version is 8.5.0, Eclipse 2019-12 – The_Sawalmeh Aug 21 '20 at 08:33
  • I recommend that you [edit] your question and add the versions of JDK and JavaFX that you are using. – Abra Aug 21 '20 at 08:35

0 Answers0