Skip to content

flathub/org.freedesktop.Sdk.Extension.openjdk21

Repository files navigation

SDK Extension for OpenJDK 21

This extension contains the OpenJDK 21 Java Runtime Environment (JRE) and Java Developement Kit (JDK).

OpenJDK 21 is the current long-term support (LTS) version.

For the previous LTS version, see the OpenJDK 17 extension.

For the current latest (non-LTS) version, see the OpenJDK extension.

Usage

You can bundle the JRE with your Flatpak application by adding this SDK extension to your Flatpak manifest and calling the install.sh script. For example:

{
  "id" : "org.example.MyApp",
  "runtime" : "org.freedesktop.Platform",
  "runtime-version" : "24.08",
  "sdk" : "org.freedesktop.Sdk",
  "sdk-extensions" : [
    "org.freedesktop.Sdk.Extension.openjdk21"
  ],
  "finish-args" : [
    "--env=PATH=/app/jre/bin:/app/bin:/usr/bin"
  ]
  "modules" : [
    {
      "name" : "openjdk",
      "buildsystem" : "simple",
      "build-commands" : [
        "/usr/lib/sdk/openjdk21/install.sh"
      ]
    },
    {
      "name" : "myapp",
      "buildsystem" : "simple",
      ....
    }
  ]
  ....
}