I'm trying to run a .jar
out of eclipse and are returning the following ERR :
C: \ Risc> java -jar GraphicalReport.jar Exception in Application start method 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 org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main (JarRsrcLoa der.java:58) Caused by: java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1 (Unknown So urce) at com.sun.javafx.application.LauncherImpl.lambda $ launchApplication $ 155 ( Unknown Source) at java.lang.Thread.run (Unknown Source) Caused by: java.lang.IllegalStateException: Location is not set. at javafx.fxml.FXMLLoader.loadImpl (Unknown Source) at javafx.fxml.FXMLLoader.load (Unknown Source) at br.ind.risc.application.ReportMain.initRootLayout (ReportMain.java:59) at br.ind.risc.application.ReportMain.start (ReportMain.java:46) at com.sun.javafx.application.LauncherImpl.lambda $ launchApplication1 $ 162 (Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda $ runAndWait $ 175 (Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda $ null $ 173 (Unknown Sourc and) at java.security.AccessController.doPrivileged (Native Method) at com.sun.javafx.application.PlatformImpl.lambda $ runLater $ 174 (Unknown S ource) at com.sun.glass.ui.InvokeLaterDispatcher $ Future.run (Unknown Source) at com.sun.glass.ui.win.WinApplication._runLoop (Native Method) at com.sun.glass.ui.win.WinApplication.lambda $ null $ 148 (Unknown Source)
Init method
/**
* inicializa o layout
*/
public void initRootLayout() {
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(ReportMain.class.getResource(" /br/ind/risc/view/RootLayout.fxml"));
rootLayout = (AnchorPane) loader.load(); //o erro está aqui.
Scene scene = new Scene(rootLayout);
primaryStage.setScene(scene);
primaryStage.centerOnScreen();
primaryStage.show();
} catch (IOException e) {
e.printStackTrace();
}
}