i've got a problem with opening my program in an artifact.
So I made a JavaFX Application with several pictures on it. Now I'm trying to launch the application in a *.jar - File but it doesnt work. I built the jar file with idea, and everything is included. I've got that errors here:
file:/I:/SDE_ManagingTool/out/artifacts/SDE_ManagingTool_jar/SDE_ManagingTool.jar!/sample/FXML/mainWindow.fxml
at javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at sample.Main.start(Main.java:17)
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 Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(Unknown Source)
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)
... 1 more
Caused by: 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 sun.reflect.misc.Trampoline.invoke(Unknown Source)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
... 13 more
Caused by: java.lang.ExceptionInInitializerError
at sample.Artikel.Amount.getImage(Amount.java:64)
at sample.Controllers.Controller.setPicture(Controller.java:1312)
at sample.Controllers.Controller.setSummaryBestellungTab(Controller.java:1229)
at sample.Controllers.Controller.updateTabPaneBestellung(Controller.java:974)
at sample.Controllers.Controller.selectFirstDataTree(Controller.java:1188)
at sample.Controllers.Controller.loadBestellTreeView(Controller.java:1155)
at sample.Controllers.Controller.loadData(Controller.java:382)
at sample.Controllers.Controller.initialize(Controller.java:368)
... 22 more
Caused by: java.lang.NullPointerException
at sample.Globals.ImageRessources.<clinit>(ImageRessources.java:9)
... 30 more
Exception running application sample.Main
I've got a Class called ImageRessources
and there are few lines with code like that:
public class ImageRessources {
public static final Image _500DominosImage = new Image(String.valueOf(ImageRessources.class.getResource("../Images/500d.png").toExternalForm()));
}
I only copied one line, the other pics are included in the same way.
Can you help me to get a launchable jar-file?
Greetings
Dani