title: Exception in Application start method due to change in FXML file structure
body: <p>Here in this project I am trying to enclose BorderPane inside StackPane but getting this error in Main.java</p>
  <p><strong>Main.java</strong></p>
  <pre><code>...
  public class Main extends Application {
      @Override
      public void start(Stage primaryStage) {
          try {
              BorderPane root = (BorderPane)FXMLLoader.load(getClass().getResource(&quot;Sample.fxml&quot;));
              Scene scene = new Scene(root,600,400);
              scene.getStylesheets().add(getClass().getResource(&quot;application.css&quot;).toExternalForm());
              primaryStage.setTitle(&quot;Struts to Spring Migrator&quot;);
              primaryStage.setScene(scene);
              primaryStage.show();
          } catch(Exception e) {
              e.printStackTrace();
          }
      }
      
      public static void main(String[] args) {
          launch(args);
      }
  }
  ...
  </code></pre>
  <p><strong>Sample.fxml</strong></p>
  <pre><code>&lt;StackPane fx:id=&quot;rootPane&quot; xmlns=&quot;http://javafx.com/javafx/8.0.112-ea&quot;
      xmlns:fx=&quot;http://javafx.com/fxml/1&quot;&gt;
      &lt;BorderPane maxHeight=&quot;-Infinity&quot; maxWidth=&quot;-Infinity&quot;
          minHeight=&quot;-Infinity&quot; minWidth=&quot;-Infinity&quot; prefHeight=&quot;400.0&quot;
          prefWidth=&quot;600.0&quot; style=&quot;-fx-background-color: #181818;&quot; xmlns=&quot;http://javafx.com/javafx/16&quot;
          xmlns:fx=&quot;http://javafx.com/fxml/1&quot; fx:controller=&quot;application.SampleController&quot;&gt;
          &lt;left&gt;
            .........
            .........
      &lt;/BorderPane&gt;
  &lt;/StackPane&gt;
  </code></pre>
  <p>The below given line is line 16 in Main which causes error. As per changes made in Sample.fxml (  tag is added above ). So that I made changes in this line</p>
  <pre><code>BorderPane root = (BorderPane)FXMLLoader.load(getClass().getResource(&quot;Sample.fxml&quot;));
  </code></pre>
  <p>to</p>
  <pre><code>StackPane root = (StackPane)FXMLLoader.load(getClass().getResource(&quot;Sample.fxml&quot;));
  </code></pre>
  <p>Still getting this error.</p>
  <pre><code>Exception in Application start method
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
      at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
  Caused by: 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$1(LauncherImpl.java:182)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.UnsupportedClassVersionError: com/jfoenix/controls/JFXDialogLayout has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      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 java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
      at java.lang.Class.getConstructor0(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at sun.reflect.misc.ReflectUtil.newInstance(Unknown Source)
      at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:927)
      at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:971)
      at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:220)
      at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:744)
      at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
      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 application.Main.start(Main.java:16)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
      at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
      ... 1 more
  Exception running application application.Main
  </code></pre>
  <p>I am new to JavaFx. Help will be appreciated.</p>