How to install, add, setup, configure the openjdk17 SDK Extension in IntelliJ-IDEA-Community flatpak application in Linux

Christian BuenoChristian Bueno
3 min read

How to install, add, setup, configure the openjdk17 SDK Extension in IntelliJ-IDEA-Community flatpak application in Linux

First, we will go to search for the org.freedesktop.Sdk.Extension.openjdk extension, to do that run the following command.

flatpak search org.freedesktop.Sdk.Extension.openjdk --columns=application,branch,remotes
Application ID                                   Branch          Remotes
org.freedesktop.Sdk.Extension.openjdk            21.08           flathub
org.freedesktop.Sdk.Extension.openjdk            20.08           flathub
org.freedesktop.Sdk.Extension.openjdk            19.08           flathub
org.freedesktop.Sdk.Extension.openjdk            18.08           flathub
org.freedesktop.Sdk.Extension.openjdk8           22.08           flathub
org.freedesktop.Sdk.Extension.openjdk8           21.08           flathub
org.freedesktop.Sdk.Extension.openjdk8           20.08           flathub
org.freedesktop.Sdk.Extension.openjdk17          22.08           flathub
org.freedesktop.Sdk.Extension.openjdk17          21.08           flathub
org.freedesktop.Sdk.Extension.openjdk17          20.08           flathub
org.freedesktop.Sdk.Extension.openjdk11          22.08           flathub
org.freedesktop.Sdk.Extension.openjdk11          21.08           flathub
org.freedesktop.Sdk.Extension.openjdk11          20.08           flathub
org.freedesktop.Sdk.Extension.openjdk11          19.08           flathub
org.freedesktop.Sdk.Extension.openjdk11          18.08           flathub

You can select any version that suits your project but is also working.

In this case the extension org.freedesktop.Sdk.Extension.openjdk, none of the branches worked. But the extension org.freedesktop.Sdk.Extension.openjdk17 in the 22.08 branch worked well.

To install the openjdk17 in the 22.08 branch, run the following command.

flatpak install flathub runtime/org.freedesktop.Sdk.Extension.openjdk17/x86_64/22.08

Or

flatpak install flathub runtime/org.freedesktop.Sdk.Extension.openjdk17//22.08

Enable openjdk on IntelliJ

There are 3 ways to enable openjdk17 in IntelliJ-IDEA-Community.

  • Add the openjdk17 manually

  • Add the openjdk17 manually and enable the environment variable FLATPAK_ENABLE_SDK_EXT temporarily.

  • Allow the application IntelliJ-IDEA-Community to automatically configure the openjdk17 Extension and enable the environment variable FLATPAK_ENABLE_SDK_EXT permanently.

Add the openjdk17 manually.

Step 1.

Run the App

flatpak run com.jetbrains.IntelliJ-IDEA-Community

In the terminal, you can check the default loaded Extensions with the app, in this case.

idea-wrapper: Setting up NPM packages
idea-wrapper: Setting up Cargo packages
idea-wrapper: Setting up Python packages
idea-wrapper: Setting up Ruby packages

Step 2

In the menu bar File> Project Structure>.

Bellow Platform Setting, click in SDKs, and click on the plus button to add a new SDK.

add SDKs

Step 3

In the shown menu click on add JDK….

In the path bar enter /usr/lib/sdk/openjdk17/jvm/openjdk-17.0.6 or /usr/lib/sdk/openjdk17/jvm/openjdk-17 either path will work.

Click OK.

Select Home directory for JDK

Then click Apply, then click OK.

Add the openjdk17 manually and enable the environment variable FLATPAK_ENABLE_SDK_EXT temporarily.

Step 1

Run the app using the FLATPAK_ENABLE_SDK_EXT environment variable.

FLATPAK_ENABLE_SDK_EXT=openjdk17 flatpak run com.jetbrains.IntelliJ-IDEA-Community

You can check the default loaded Extensions and the new openjdk17 extension being loaded.

idea-wrapper: Evaluating /usr/lib/sdk/openjdk17/enable.sh
idea-wrapper: Setting up NPM packages
idea-wrapper: Setting up Cargo packages
idea-wrapper: Setting up Python packages
idea-wrapper: Setting up Ruby packages

Step 2

Follow Step 2 of Add the openjdk17 manually.

Step 3

This time the SDK will be detected by the App and will be shown there.

Detected SDKs

Click on it, Apply and OK.

Allow the application IntelliJ-IDEA-Community to automatically configure the openjdk17 Extension and enable the environment variable FLATPAK_ENABLE_SDK_EXT permanently.

Step 1

You can check the value of the FLATPAK_ENABLE_SDK_EXT environment.

Get access to a shell prompt inside the application sandbox.

flatpak run --command=sh com.jetbrains.IntelliJ-IDEA-Community

Here check the current value of the environment variable FLATPAK_ENABLE_SDK_EXT.

echo $FLATPAK_ENABLE_SDK_EXT

value of the environment variable FLATPAK_ENABLE_SDK_EXT

Close the shell session with CTRL+ D.

Step 2

Run the following command to set openjdk17 as an extra extension permanently.

flatpak override --user com.jetbrains.IntelliJ-IDEA-Community --env=FLATPAK_ENABLE_SDK_EXT="openjdk17"

Step 3

Check again the environment variable FLATPAK_ENABLE_SDK_EXT.

flatpak run --command=sh com.jetbrains.IntelliJ-IDEA-Community

echo $FLATPAK_ENABLE_SDK_EXT

This time the value of the environment variable will be openjdk17.

the value of the environment variable will be openjdk17

You can close the shell session if you like with CTRL+ D.

Step 3

Run the app IntelliJ-IDEA-Community.

This time the openjdk extension will be configured automatically.

In case the openjdk17 extension will not be configured automatically, follow the item Add the openjdk17 manually and enable the environment variable FLATPAK_ENABLE_SDK_EXT temporarily, steps 1 to 3.

0
Subscribe to my newsletter

Read articles from Christian Bueno directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Christian Bueno
Christian Bueno

I'm a Full Stack Web Developer Django, Flask Developer. Python Developer. Fronted UI Developer. Linux server administrator. Containerization Developer. Automation Developer, DevOps engineer.