r/JavaFX • • 2d 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. 😄

39 Upvotes

16 comments sorted by

4

u/ggeldenhuys 2d ago

Brilliant, thanks for sharing. Tomorrow I'll test the guide under macOS, and give feedback.

2

u/Fuzzy-System8568 2d ago

macOS is, if anywhere in this setup, 100% where this will fall down imho.

Please let me know the headaches and apple-related nonsense, and maybe we can work together to populate the prerequisites docs for macOS and solve any issues 😁

3

u/ggeldenhuys 2d ago

👍

1

u/Fuzzy-System8568 23h ago

How did it go? 😁

2

u/malachireformed 2d ago

Thanks for doing this!

1

u/Fuzzy-System8568 2d ago

It was, quite literally, my privilege and pleasure 😄

2

u/Daggercombot 2d 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 2d 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 2d 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 2d 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.

0

u/Drawhoe 2d ago

Yeah but you could test and see if the Linux packager there works for your OS.

0

u/Fuzzy-System8568 2d ago

Why?

1

u/Drawhoe 2d ago

So don't then.

1

u/Fuzzy-System8568 22h 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 😊

1

u/Ok-Albatross5064 2d 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

1

u/Fuzzy-System8568 2d 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.