After hours of trying understand how to set up VSCodium with Java extension, i found a solution so here it is, idiotproof (i hope) tutorial for future me and others like me ;)
Flatpak VSCodium with java extension
Via Terminal
- Install VSCodium:
flatpak install com.vscodium.codium
- Install “Extension Pack for Java” extension for VSCodium:
flatpak run com.vscodium.codium --install-extension vscjava.vscode-java-pack
- Install flatpak openjdk extension. (In this case openjdk21):
flatpak install flathub org.freedesktop.Sdk.Extension.openjdk21
- Add two new environment to use flatpak openjdk extension in VSCodium:
flatpak override --user --env=JAVA_HOME=/usr/lib/sdk/openjdk21 com.vscodium.codium && flatpak override --user --env=PATH=/usr/lib/sdk/openjdk21/bin:/app/bin:/usr/bin com.vscodium.codium
- Restart VSCodium:
flatpak kill com.vscodium.codium && flatpak run com.vscodium.codium
- Done.
Via Graphical interface
- Install “VSCodium”:
- Go to app store and search for “VSCodium”.
- Make sure it’s flatpak versionn.
- Click
Install
button and after downloading open the app.
- Install “Extension Pack for Java” extension in VSCodium:
- Go to
Extensions
pannel (on the left). - Search for “Extension Pack for Java”.
- Click
Install
button. - Close “VSCodium”.
- Go to
- Install flatpak openjdk extension. (In this case openjdk21):
- Search for “Terminal” app and open it.
- Paste command below:
flatpak install flathub org.freedesktop.Sdk.Extension.openjdk21
3. Click `Enter`.
4. Close "Terminal".
- Install “Flatseal”:
- Go to app store and search for “Flatseal”.
- Click
Install
button and after downloading open the app.
- Allow VSCodium to use flatpak openjdk extension:
- Search for “VSCodium” in Flatseal.
- Go to Environment.
- Click
+
button (to the right from Variables) and paste:
PATH=/usr/lib/sdk/openjdk21/bin:/app/bin:/usr/bin
4. Click `+` once again and paste:
JAVA_HOME=/usr/lib/sdk/openjdk21
- Restart VSCodium
PS
There is formatting issue with markdown but it’s on lemmy side i think
This is overly complicated. Just install Java then run
flatpak --user override --env="FLATPAK_ENABLE_SDK_EXT=openjdk" com.vscodium.codium
Note this works for all other SDKs too. It works especially well for programming languages like Rust that have their own package manager.
Doesn’t work so well for languages like C/C++ where you use your distro package manager to install dependencies. In those cases it’s easier to install VSCodium inside a container where you do have access to a distro package manager.
Note that I could write it with 2 commands too, but I wanted it to be as ease as possible because who knows if I will remember what I meant