Are you talking about the build\module-lib dir? I'm guessing that it's to
not depend on what the OS provides and ship your own dependencies. I
noticed that the ucrtbase.dll file, for example, isn't the same in the
module's build directory and my System32 directory. Perhaps Windows updated
since I last built the module, so that could explain the difference.

As for SWT, there's a comment in the build file about it:
https://github.com/openjdk/jfx/blob/6ddb2b2f76a2facfd9d1345787cfa4a6658b0412/build.gradle#L5976

And it seems that the SWT project wasn't completely understood at the time
of authoring the build file:
https://github.com/openjdk/jfx/blob/6ddb2b2f76a2facfd9d1345787cfa4a6658b0412/build.gradle#L5334

On Sat, Apr 11, 2026 at 1:12 PM Marius Hanl <[email protected]> wrote:

> 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
>

Reply via email to