I'm using Eclipse
and making a simple game in javaFX. I have images and need to package them and the javafx into a runnable file. I am not using any of the css stuff related to javafx, just the basic windows and stages and stuff.
Thanks!
I have tried to just export it however it did not work.
Part 1
A JavaFX Eclipse Project is like:
So with the above you are sure that every library and resource will be in the
1)Into the final Jar
or
2)You will have a final Jar and a separate folder which contains all the external libraries you are using.
or
3) (2)+External Folder for other resources
Exporting the Project:
1)Right Click on the Project
2)Export->Java->Runnable Jar File...
3)Choose your main class
4)On Library Handling it is your choice(better choose the 3rd option cause it prevents conflicts on libraries which containing same classes and doesn't violate some libraries licence)
5)Export It
Finally
Also have a look at this link which was provided in the comments.
Part 2)
After you have done the above you can use Launch4J to package your jar file into an .exe file(for Windows)
Part 3)
You can also export your JavaFX Project in a way that it can be used in windows,Mac and Linux.
For that you can use the file build.fxbuild and build the project(big topic search for it on internet)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With