How to create a fat jar for my JavaFX program?

Davide Perini perini.davide at
Mon Jul 20 17:37:18 UTC 2020

thanks for the answer, I appreciate it.

I am trying with jpackage (that bundles my fat jar with some more dlls),
but when I try to run my app I get this error:
Error: JavaFX runtime components are missing, and are required to run 
this application

Any idea?


Il 20/07/2020 19.30, Matthias Bläsing ha scritto:
> Hi,
> Am Montag, den 20.07.2020, 19:25 +0200 schrieb Davide Perini:
>> Unfortunantly so few dependencies supports Java Modules this day, so
>> fat JAR is the only way I can do it.
> no it is not. There are seveal ways how to bundle native libraries.
> jpackage is one way, fat jars are another. And for fat jars of course
> you can extract native libraries at runtime (JNA does exactly that).
> What is difficult is the handling of native dependencies. If you know
> what you are doing you can manually load native libraries in the right
> order.
> The alternative is to distribute a ZIP file and setup the paths prior
> to loading libraries. Changing the java.library.path takes some
> reflection, but it is possible to do at runtime.
> The javafx jars from maven central hold the native libraries.
> Matthias

More information about the openjfx-dev mailing list