Java sdk-extensions needed on runtime when app has self-contained JRE?


we are on the way to flatpak Cryptomator.
The application is build with a self-contained and stripped down JRE in order to minimize the needed disc space. The self-contained JRE is intended and capable to run the app.

The manifest contains the build-commands to compile the app from source. Does Flatpaks distinguish stuff required at runtime (‘runtime’) from stuff required only during build (‘sdk’)?

We would like to drop the OpenJDK module when publishing the app on flathub if possible, but are not sure if there is a way to achieve this.


Kinds regards,

The sdk-extensions are only available from the SDK & not accessible from the Platform. In this case, flatpak-builder distinguishes between runtime & sdk, you don’t have to do anything.

I’m not completely sure with the Java packaging, but I believe you should be able to drop your openjdk module, too. It’s only required if you want to copy the JRE (for the JDK you’d execute into your /app-prefix.

But since you’re directly using the org.freedesktop.Sdk.Extension.openjdk17-extension (via JAVA_HOME etc.), jlink & jpackage should already create your stripped down JRE from /usr/lib/sdk/openjdk17/jvm/openjdk-17 & just ignore /app/jre (the destination).

1 Like