So this worked in the example from javafx when My pc had jdk 1.7.0 so this may be the new version of FX in java8 however;
I get a nice stack-trace
jf
You used
Pane mainPane = FXMLLoader.load(getClass().getResource("main.fxml"));
Try
Pane mainPane = FXMLLoader.load(getClass().getResource("/main.fxml"));