title: javaFX program not working after changing the scene builder and jdk
body: <p>My program worked perfectly before, And I changed my scene builder to gluon scene builder 10 from JavaFx scene builder 2.0 to add some CSS styling. I added the styling and the program showed errors like  <strong>WARNING: Loading FXML document with JavaFX API of version 10.0.1 by JavaFX runtime of version 9.0.4</strong>  And then I updated my JDK to version 10.0.2 but it stii shows errors like this.</p>
  
  <pre><code>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:564)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372)
      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:564)
      at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:941)
  Caused by: java.lang.RuntimeException: Exception in Application start method
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
      at java.base/java.lang.Thread.run(Thread.java:844)
  Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/parser/CSSParser
      at de.jensd.fx.glyphs.GlyphIcon.&lt;clinit&gt;(GlyphIcon.java:48)
      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.newInstance(Constructor.java:488)
      at java.base/java.lang.Class.newInstance(Class.java:560)
      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:3253)
      at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3210)
      at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3179)
      at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3152)
      at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3129)
      at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3122)
      at sample.Main.start(Main.java:17)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
      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:175)
      ... 1 more
  Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.parser.CSSParser
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
      ... 27 more
  Exception running application sample.Main
  </code></pre>
  
  <p>My main class is </p>
  
  <pre><code>public class Main extends Application {    
  
      @Override
      public void start(Stage primaryStage) throws Exception{
          Parent root = FXMLLoader.load(getClass().getResource("../Interface/sample.fxml"));
          primaryStage.setTitle("JFS");
          primaryStage.setScene(new Scene(root, 600, 400));
          primaryStage.show();    
      }  
  
      public static void main(String[] args) {
          launch(args);
      }
  
  }
  </code></pre>
  
  <p>My Controller class is </p>
  
  <pre><code>public class Controller {
  
      public TextField newsletterEmail;
      public JFXButton regButton;
      public JFXTextField loginUserName;
      public JFXPasswordField loginPassword;
      public JFXButton loginButton;
      Connectivity connection = new Connectivity();
      Connection connec = connection.getConnection();
      SceneSwitcher sceneSwitcher = new SceneSwitcher();
      ViewMyAccount viewMyAccount = new ViewMyAccount();
  
      loginValidation validateLogin = new loginValidation();
  
      public void loginButtonClicked(ActionEvent actionEvent) {
  
          System.out.println(loginUserName.getText());
          /*viewMyAccount.setMailLabel(loginUserName.getText());
          System.out.println(viewMyAccount.getMailLabel());*/
  
  
          boolean validateCustomer = validateLogin.CusLoginValidate(loginUserName.getText(),loginPassword.getText(),connec);
          boolean validateStaff = validateLogin.StaffLoginValidate(loginUserName.getText(),loginPassword.getText(),connec);
          boolean validateOwner = validateLogin.OwnerLoginValidate(loginUserName.getText(),loginPassword.getText(),connec);
  
          if(loginUserName.getText().equals("") || loginPassword.getText().equals("")){
              AlertBox.displayAlertBox("ERROR!","Both fields can't be empty!");
          }else{
              if(validateCustomer){
                  sceneSwitcher.switchScene(loginButton,"customerView.fxml","Customer");
              }else if(validateStaff){
                  sceneSwitcher.switchScene(loginButton,"staffView.fxml","Customer");
              }else if(validateOwner){
                  sceneSwitcher.switchScene(loginButton,"ownerView.fxml","Customer");
              }else{
                  AlertBox.displayAlertBox("ERROR!","Invalid Username or Password! ");
              }
          }     
  
      }
  
      public void registerButtonClicked(ActionEvent actionEvent) {
  
          sceneSwitcher.switchScene(regButton,"register.fxml","Register");
      }
  
      NewsletterValidation validateEmail = new NewsletterValidation();
  
      public void newsletterButtonClicked(ActionEvent actionEvent) throws SQLException {
  
  
          boolean isNewsletterEmailEmpty = validateEmail.invalidError(newsletterEmail);
          boolean isValid = validateEmail.isValidEmailAddress(newsletterEmail);
          boolean isEmailExist = validateEmail.checkEmailExists(newsletterEmail.getText(),connec);
  
          if(isNewsletterEmailEmpty &amp;&amp; isValid &amp;&amp; isEmailExist){
  
              PreparedStatement pstmt = null;
              String sql = "INSERT INTO `nwemails` (`email`)\n" +
                      "VALUES (?);";        
  
              try {
                  pstmt = connec.prepareStatement(sql);
                  pstmt.setString(1,newsletterEmail.getText());
  
                  int i = pstmt.executeUpdate();
                  System.out.println("newsletter email update status = " + i);
                  AlertBox.displayAlertBox("Alert!","You have successfully signed up for the news letter");
  
  
              } catch (SQLException e) {
                  System.err.println(e);
              }finally {
                  pstmt.close();
              }
  
          }else{
              System.out.println("Validation failed");
          }   
  
      }   
  
  }
  </code></pre>
  
  <p>my FXML file is </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import com.jfoenix.controls.JFXButton?&gt;
  &lt;?import com.jfoenix.controls.JFXPasswordField?&gt;
  &lt;?import com.jfoenix.controls.JFXTextField?&gt;
  &lt;?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?&gt;
  &lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.Label?&gt;
  &lt;?import javafx.scene.control.TextField?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  &lt;?import javafx.scene.text.Font?&gt;
  
  &lt;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" stylesheets="@../CSS/dracula.css" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller"&gt;
     &lt;children&gt;
        &lt;Label layoutX="227.0" layoutY="259.0" prefHeight="17.0" prefWidth="127.0" text="Don't have an account?" /&gt;
        &lt;Label layoutX="207.0" prefHeight="74.0" prefWidth="182.0" text="JFS" AnchorPane.leftAnchor="207.0" AnchorPane.rightAnchor="211.0" AnchorPane.topAnchor="0.0"&gt;
           &lt;font&gt;
              &lt;Font name="Matura MT Script Capitals" size="53.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Label layoutX="241.0" layoutY="98.0" prefHeight="17.0" prefWidth="118.0" text="Jeff's Fishing Shack" textAlignment="CENTER"&gt;
           &lt;font&gt;
              &lt;Font name="Marlett" size="13.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Button layoutX="186.0" layoutY="370.0" mnemonicParsing="false" onAction="#newsletterButtonClicked" prefHeight="25.0" prefWidth="210.0" text="Send me Updates" /&gt;
        &lt;Label layoutX="111.0" layoutY="316.0" prefHeight="17.0" prefWidth="378.0" text="Or sign up for The free newsletter covering the top industry headlines" /&gt;
        &lt;TextField fx:id="newsletterEmail" layoutX="195.0" layoutY="339.0" prefHeight="25.0" prefWidth="191.0" promptText="Email" /&gt;
        &lt;JFXTextField fx:id="loginUserName" layoutX="203.0" layoutY="136.0" prefHeight="25.0" prefWidth="191.0" promptText="Username (email)" /&gt;
        &lt;JFXPasswordField fx:id="loginPassword" layoutX="203.0" layoutY="185.0" prefHeight="25.0" prefWidth="191.0" promptText="Password" /&gt;
        &lt;FontAwesomeIconView glyphName="USER" layoutX="171.0" layoutY="161.0" size="25.0" wrappingWidth="15.0" /&gt;
        &lt;FontAwesomeIconView glyphName="KEY" layoutX="170.0" layoutY="208.0" size="25.0" wrappingWidth="15.0" /&gt;
        &lt;JFXButton fx:id="loginButton" layoutX="265.0" layoutY="225.0" onAction="#loginButtonClicked" text="LOGIN" /&gt;
        &lt;JFXButton fx:id="regButton" layoutX="257.0" layoutY="284.0" onAction="#registerButtonClicked" text="REGISTER" /&gt;
     &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>The stacktrace show this like as the wrong line</p>
  
  <pre><code>Parent root = FXMLLoader.load(getClass().getResource("../Interface/sample.fxml"));
  </code></pre>
  
  <p>I've been wasting more than 3 hours for finding an answer. So please help me with this.</p>
  
  <p>the fontawesome version:</p>
  
  <p><img src="https://i.stack.imgur.com/NEzVm.png" alt="font awesome versions"></p>