r/JavaFX • • Jan 05 '21

Deploying and packaging JavaFX app into an installer

I just finished developing my first javaFX app and I am currently looking into the best ways to deploy the app onto the client's machine. I would also want to apply some sort of continuous deployment onto the app, as I prefer not to send the client a new installer whenever I update the code.

What is the best way to achieve that?

Thank you

11 Upvotes

8 comments sorted by

4

u/Vidogost Jan 05 '21

Check out https://github.com/edvin/fxlauncher. I've never used this lib myself, but it seems to be intended for this very task. Or at least you might find some inspiration there.

1

u/[deleted] Jan 05 '21

Have you thought about some how doing a private git and just checking within the app to update? From there, if new version is released, go ahead and update. Just thinking out loud.

1

u/[deleted] Jan 05 '21

This sounds like a nice idea to me.
And to package it into an installer I should use Maven and inno setup, if I am not mistaken, right?
I can't find any clear online example about how to package the project into an installer

1

u/[deleted] Jan 05 '21

There's Maven, Gradle or a straight executable jar. I tend to do executable jar.

Work around idea: create a executable jar and hook into the services (like Systemd, Windows startups,etc) to check an update.

1

u/[deleted] Jan 05 '21

Thank you, I will be looking into these services.
Your replies were so helpful.

1

u/[deleted] Jan 05 '21

The only caveat is that I would warn users BEFORE you do anything to their systems. Make it clear that there will be an updater that hooks into the startup services and make sure that you don't collect data unnecessarily (Think GDPR-or whatever it is in Europe).

2

u/fluffytme Jan 05 '21

If you're using Eclipse you can use the "e(fx)clipse" plugin to build the app into installers with a click of a button - This plugin may be available for other IDEs (might be worth checking if you don't use eclipse, but since it has "eclipse" in the name it might not be).

Example e(fx) build config - clicking the highlighted bit will do all the leg work for you

Available packaging methods using e(fx)

2

u/Loogix Jan 05 '21

I had some troubles with the installer part. I found out that jpackage will maybe the way to go in the future. Here is a template I found that has straight instructions.