How create native builds for all possible platforms?

91 Views Asked by At

I have JavaFx application(OpenFx 20 + Java 17) with Jetty Server. My target build installers for such platform:

  1. Linux
  2. Windows
  3. MAC OS

I found framework https://gluonhq.com/ that appropriate for my task. But this approach doesn't support cross platform compilation.

So I need create docker image for each platform for preparing particular installer. And as I know MAC OS image doesn't available on docker hub.

My question is what is the best way to build installer for all platform? Maybe some prepared solution available (even if it's non open source) ?

1

There are 1 best solutions below

0
jewelsea On

Possible options

I will not even try to recommend which is "best". Some of the options I have not used.

You could try jdeploy -> their marketing says "Deploy your app to Mac, Linux, and Windows users without the usual hassles.".

AsciidocFX (I think) accomplishes this using install4j. Looks very complex to me though, even though install4j site says "Deploying on multiple platforms doesn't get easier than this." But perhaps they are right and deploying to multiple platforms is just inherently complex. The AsciidocFX approach is very professional, it handles installers for multiple platforms, customized install wizards on various platforms, code signing Mac apps, M1 and x64 Macs, software updates, etc. It seems to do this via a combination of maven install4j plugins and a (very) long install4j config file.

You can run jpackage on multiple operating systems. This requires you to have the operating system using the appropriate architecture. For instance, you would need both an Intel x64 Mac and an ARM M series Mac if you wanted to build for both of those platforms. Paid signing certificates from Apple are probably required for deployment to locations like the Apple App store. There are quite some pitfalls and trials in trying to use jpackage to do this. JpackageScriptFX might assist with that.

jlink can create cross platform images, but those aren't installers. See also using badass-runtime-plugin to create cross platform jlink images using gradle.