问题: 我正在使用jFonix的外部Biblithok。该库也插入了BuildPath中。
在Eclipse中,程序运行100%。
执行可执行jar时,出现错误:
Could not find stylesheet: Jar: file: / path .....
Parent root = FXMLLoader.load(this.getClass().getResource("GUI.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(this.getClass().getResource("application.css").toExternalForm());
primaryStage.show();
错误cmd:
java -jar test.jar
Feb 08, 2019 12:00:23 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
INFO: Could not find stylesheet: jar:file:/C:/Users/xxx/Desktop/test.jar!/bin/application/application.css
结构: 项目名称
-src-Folder
-application-package
- Main.java
- Controller.java
- application.css
- GUI.fxml
-img-Folder
- images.png
-Referenced Libraires
- jfonenix.jar
- many packages
- css.controls
- many .css