Reputation: 890
I try to export a Java-Project with different Libraries included a JavaFX GUI and lots of different stuff to a runnable JAR file. When i run my project in eclipse there is no problem. But when I try to export it to a runnable JAR file and afterwards i try to start is it never opens a window there is just a process running in the background.
I don't know how to describe my problem better. But maybe you can help me with this information already.
(using eclipse)
Upvotes: 0
Views: 1955
Reputation: 36792
Exporting a jar for a javafx project in eclipse, has always ended up with some problem or the other for me. May be, though I am not sure, eclipse packages the jar as per Swing
configurations, where as Javafx
needs some peculiar configuration. For details visit
http://docs.oracle.com/javafx/2/deployment/packaging.htm
For an easier method, you can always port your project to NetBeans
and use the jar that is created by it ! The jar
created by Netbeans
works flawlessly for me !
Upvotes: 1
Reputation: 414
The probable issue is like the dependent Jars are not in place. Are you providing any VM arguments to run your Application from Eclipse.
If Yes, then please note you can't provide VM arguments in the Runnable Jar.
Solution is , you can use "Launch4J" to pass VM arguments to your application.
" VM arguments will not be part of the runnable JAR. Arguments can be passed on the command line when launching the JAR".
While creating the Runnable Jar, check first checkbox "Extract Required Libraries into generated JAR".
Cheers .. :)
Subh
Upvotes: 0
Reputation: 631
You should be using the option "Export Runnable JAR File" and "Extract required libraries into generated JAR".
Try also adding the jfxrt.jar to the Java Build Path when not using Java 8.
Upvotes: 0