Bump, anyone has an idea? I'm still very much interested why this is the
case.
Especially as this saves quite a bit of the final binary size.
-- Marius
Am 25.02.2026 um 20:37 schrieb Marius Hanl:
Hey all, when checking how the size of JavaFX applications can be
reduced further (beside removing the hard dependency on
java. desktop), I found two interesting things I was wondering about.
First: This might be dumb question (maybe :P), but
Hey all,
when checking how the size of JavaFX applications can be reduced
further (beside removing the hard dependency on java.desktop), I found
two interesting things I was wondering about.
First:
This might be dumb question (maybe :P), but why do we copy the Windows
DLLs into the javafx.graphics module?
I just removed them to test what happens, and to my surprise, the
application still works and the NativeLibLoader will load those from
Windows itself instead.
That also means that those DLLs don't need to be copied into the TEMP
folder when working with e.g. Maven.
But more interesting to me, this will reduce the size of my JPackaged
Application by ~3 MB. Which is not bad.
So I wonder, why this is needed, and if it makes sense to turn off
this behavior (optionally) with a Gradle flag.
Second:
Why does the javafx.graphics module contains a 'javafx-swt.jar'? While
it is not that big (0.32MB), it seems to be a bit weird.
Note: Those claims can be verified when opening the latest
javafx-graphics-27-ea+5-win.jar with 7z (for example).
Note2: I did not check the other platforms. I'm mostly interested in
Windows, because that is what most of the companies use in the industy.
For more Context: At this point in time, I only ever had to create
Windows binary files (.exe or .msi) for those projects (Wished by the
customer).
Even more Context: With removing the hard dependency to java.desktop,
not shipping the DLLs and the SWT jar, my applications usually went
from ~70 MB to ~57MB. Using JMods.
This is a pretty good result, especially when we compare against other
ways to build and package an Application like Electron, where
applications are usually around ~100 MB, that sometimes can be
optimized to around ~70 MB.
-- Marius