r/JavaFX • u/Fuzzy-System8568 • 12d ago
I made this! JavaFX Packaging: A Developer's Guide (Demo / Guide Repo for teaching developers how to Package JavaFX Applications via Maven)
A few months ago I came here and asked how best to package JavaFX applications. I was met with people pointing me at third party tools (that abstract away the details and theory), people's own personal setups, but with little context of how / why they were setup like that and other "not quite what I was looking for" guidance.
God knows the official documentation doesn't make it easily clear. As such, it seemed there was a legitimate gap on what, to me personally, seems like a pretty fundamental step of using JavaFX.
So I decided to say "sod it" and make my own guide.
Here is a link to the repo of the project
It is quite simply a default "HelloApplication" project, but with a pom.xml setup to package the application into an OS-specific distributable that, should be JDK/JRE independent (i.e. self-contained).
Along with this, there are several markdown documents explaining the workflow of the packaging solution, along with details on each of the steps of the workflow (i.e. each plugin, the properties in the pom.xml ,etc).
The only limitation now is, I am but one developer on one Operating System (CachyOS) and would love other contributors to provide insight into the per-distro / per OS requirements (such as specific build tools like the WiX toolset), as they are quite sparse as of the moment, with that sparse nature being identified within the documentation itself.
Either way, I hope this helps anyone who, like me a few a months ago, struggled to find an explanation of how to set up packaging a JavaFX app, and was shocked to find there was next to nothing out there. 😄
3
3
u/Daggercombot 12d ago
Would this allow people to specify jfx binaries? Such as Solaris does not have an official JFX binary but unofficial ones do exist so users of that OS should be able to specify.
2
u/Fuzzy-System8568 12d ago
Nope, I was not even aware of this being a thing to be honest (I have not ventured too far out of the Linux / Windows ecosystem myself).
If you believe there is a use case for it, maybe you would be up for contributing and adding the functionality to specify the jfx binary / writing a guide / explanation of the functionality into documentation?
2
u/Drawhoe 12d ago
Have a look here https://github.com/javapackager/JavaPackager I'm working on a game targeting Windows, Mac and Linux and I use that to package for Linux Mint.
2
u/Fuzzy-System8568 12d ago
Respectfully, please note I covered the idea of third party solutions not actually helping a new developers understand the concepts behind packaging a JavaFX application. I did so in the first paragraph of the OP.
This repo is to share the knowledge to those learning the framework. It is not simply to provide a third party solution.
1
u/Fuzzy-System8568 10d ago
I am still actively looking for macOS users and Windows users to give this a stab and see what issues there are / what guidance could be added to the repo 😊
2
u/SpittingBull 7d ago
With Windows you have two challenges in general:
Taking care of the native libraries
Creating an executable
The later is nicely covered here IMO: https://www.javathinking.com/blog/how-can-i-package-a-java-desktop-application/#step-by-step-packaging-for-windows-exe
1
1
u/Ok-Albatross5064 12d ago
Does your tool accept Gradle because I don't use pom on my projects for example. I'm working on a Javafx project currently, I'm going to test it with releases and for Windows and macOs
2
u/Fuzzy-System8568 12d ago
It is not a tool. It is a guide on how to do it via Maven.
I am sorry to say but the reason I did this is because there are not really guides on how do it for either build tools. So I have no advice for gradle.
4
u/ggeldenhuys 12d ago
Brilliant, thanks for sharing. Tomorrow I'll test the guide under macOS, and give feedback.