简体   繁体   中英

FXML - Jar to .exe fail

I found several similar problems, but nowhere I found true and working solution for this problem, so I ask the world if somebody solved it this JavaFX problem?

I tried to make .exe from my JavaFX project (.jar file) with several converter softwares, but I get this error message from all (below) What could cause this, if the .jar file is working if I open it?

(My file hierarchy is something like this:)

-/lib/derby.jar                                            (set as Native)
-/lib/derbyclient.jar                                      (set as Native)
-/lib/derbynet.jar                                         (set as Native)
-/lib/itextpdf-5.5.5.jar                                   (set as Native)
-/lib/jfxtras-labs-samples-8.0-r4-SNAPSHOT-shadow.jar      (set as Native)
-Utiokos.jar(with the main class)                      (set as Main)

The error message I get from the start of the .exe after converting:

java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$1/15539988.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Caused by: javafx.fxml.LoadException: 
file:/C:/Users/MrFireman/AppData/Local/Temp/e4jB580.tmp_dir1427146294/Utiokos.jar!/Utiokos/Foablak.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.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at Utiokos.Utiokos.start(Utiokos.java:27)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$50/20813951.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/2077920.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/29246076.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/17481965.run(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$141(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$38/28810240.run(Unknown Source)
... 1 more
Caused by: java.lang.NullPointerException
at Utiokos.AdatbazisKapcsolat.aktivNev(AdatbazisKapcsolat.java:228)
at Utiokos.FoablakController.initialize(FoablakController.java:2547)
... 23 more

The solution was to not just add the /lib/xy.jar as a Native, but also as a classpath!

That way everything is working properly in the .exe! ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM