I face a problem with a project. I make a simple game in Eclipse using JavaFX. In the beginning I faced a problem with this command in FXMLLoader
root = FXMLLoader.load(Main.class.getResource("\\application\\design.fxml"));
.
When I changed the command to
root = FXMLLoader.load(getClass().getClassLoader().getResource("\\application\\design.fxml"));
the program runs perfect. Now I decided to export the project to a runnable jar but when I try to run the jar it's not working. I used exe4jwizard and I found out that the problem was on FXMLLoader with this error:
java.lang.NullPointerException: Location is required.