I am getting an error while I try to run executable jar file.
lis 09, 2014 8:20:34 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged WARNING: Resource "/styles.css" not found.
When I'm running application from IDE, everything is OK. I try a several solution, but neither worked.
1.
scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());
2.
scene.getStylesheets().add("styles.css");
3.
scene.getStylesheets().addAll(new File("/styles.css").toURI().toString());
4
InputStream inputStream = MainApp.class.getResourceAsStream("/styles.css");
File tempStyleSheetDest = File.createTempFile("javafx_stylesheet", "");
tempStyleSheetDest.deleteOnExit();
Files.copy(inputStream, tempStyleSheetDest.toPath(), StandardCopyOption.REPLACE_EXISTING);
scene.getStylesheets().add(tempStyleSheetDest.toURI().toString());
And another similar. I struggle this a few hours and I have no more ideas. I'm using maven, java1.8_u20.