title: JavaFX launch(args) method throws java.lang.reflect.InvocationTargetException, java.lang.NullPointerException
body: <p>So I was trying to launch my JavaFX application and a stack trace error showed up:</p>
  
  <pre><code>Exception in thread "main" 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 sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
  Caused by: java.lang.NullPointerException
      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(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
  </code></pre>
  
  <p>And I wondered what was going. At the bottom of the stack trace it says there's a NullPointer at the launch(args) method. I tried everything but I couldn't get it to work. This is my code:</p>
  
  <pre><code>public class Main extends Application{
  public void main(String[] args){
      launch(args);
  }
  
  //START
  //GUI
  
  @Override
  public void start(Stage primarystage) throws Exception {
      SplitPane fullpane = new SplitPane();
      //DECK
      ScrollPane deckscrollpane = new ScrollPane();
      AnchorPane deck = new AnchorPane();
      deck.setOnMouseClicked((e)-&gt;{
          System.out.println(e.getSceneX());
          System.out.println(e.getSceneY());
      });
      Rectangle rec = new Rectangle();
      rec.setTranslateX(23);
      rec.setTranslateY(20);
      rec.setWidth(200);
      rec.setHeight(300);
      deck.getChildren().add(rec);
      deckscrollpane.setContent(deck);
      //MAP
      StackPane map = new StackPane();
      fullpane.getItems().addAll(deckscrollpane, map);
      fullpane.setDividerPositions(0.4f, 0.6f);
      Scene scn = new Scene(fullpane, 700, 700);
      primarystage.setScene(scn);
      primarystage.show();
  }
  }
  </code></pre>
  
  <p>I'm pretty new to JavaFX, and I was hoping someone fairly experienced can explain how I'm supposed to fix this. My IDE (Eclipse) isn't showing any errors in the code either. The error only pops up when I run the program. I installed the JavaFX plugin (I think it's called something like e(fx)clipse or somethin' like that). A little help?</p>