JDK install location with flatpak

I have installed (using swupd) the java11-basic package which says it will let me build and run java applications. Sounds like the JDK to me.

I have installed Intellij-IDEA from flathub and I don’t know where the JDK will have been installed by this bundle.

Is there a simple way to find it’s location using flatpak? Is there a better/preferred method of installed the JDK?

Look at /usr/lib/jvm/java-1.11.0-openjdk/

and ls -l /usr/bin/java*

Also flatpak uses its own java package, loot for it at flatpak list

That’s great, I can see them within the terminal, but the flatpak installation of Intellij-IDEA doesn’t seem to be able to browse there. Typing the file paths in by hand also results in an error, saying “specified path cannot be found”

When you say Flatpak uses it’s own java package, does that mean that if I’m using a flatpak application, I should only use the flatpak installation of the JDK?

Using the JDK from flatpak, rather than from the java11-basic swupd bundle has resulted in a location I can use from the intellij-IDEA application.

So having it working is great, but I would like to understand why it’s working with the flatpak version but couldn’t find it when I installed the java11-basic bundle from swupd.

Flatpak is a sandbox, so it contains all you need to run your app.

You can find where is installed with flatpak info com.jetbrains.IntelliJ-IDEA-Community or the name of the Intellij-IDEA you install. Look for the Location: tag.

There you will find files/extra where the jre is installed.

I ran into the exact same problem. I spent an hour or two on it before I realized that IntelliJ was in its own sandbox, which made my dev process almost impossible. Maybe that will work for some…but not me.
These instructions, though old, basically worked for me:


There is even a command to have intelliJ create the .desktop file for you so you can have it on the panel and everything.
I just downloaded the regular IntelliJ bundle and put it in my user directory and it performed as expected. Well, actually, it performs orders of magnitude better than on Ubuntu, and now my dev environment is quite nice. The flatpak stuff is great, but for things like an IDE I am not convinced it is the right way to go.

1 Like

Ah ok, so this will contain the runtime, to actually run the application… but not the SDK which will be required within the application to build software.

I will spend some time going through the Flatpak documentation to get a better understanding of what happens with these applications, how they are structured etc…

You can download the IntelliJ IDEA from its official website, where you can choose to download the one with or withou a full JDK.

This one does not need to be installed, and you can launch it directly.

I really wouldn’t waste any time with the flatpak…Well, at least I didn’t have the spare time to mess with it. I’d need to configure the flatpak environment to mirror the actual system environment I had already configured. Things like the terminal in IntelliJ are sandboxed, which is beyond frustrating. Installing the Native Terminal IntelliJ plugin didn’t help either. Basically, dealing with the sandboxed IntelliJ is probably one of the more frustrating experiences I have been through.

I have exactly the same issue with vscode.

I need it to find the dart sdk.

I installed the dart-sdk but I cannot get vscode to find the directory it is in because of the sandbox.

Flatpak for deploying an application with fixed resources is fine but and IDE like IntelliJ or vscode cannot function in a sandbox unless you can define external resources. I looked at the flatpak documentation but could not get overrides or --filesystem=path-to-dart-sdk to work.

I also need the golang tools installed in vscode so that is more complexity again!

I have tried for hours to get vscode to find dart-sdk now I am uninstalling vscode and installing it outside of flatpak. I will have to do the same with IntilliJ, my normal IDE for Java development.

Does anyone have a solution that can be applied across all flatpak applications like this. We cannot be the first people to find this issue.

Stuart

Try this.

flatpak list

This will give you a list of the current flatpak id’s. In my case I was interested in

com.visualstudio.code

the resource I needed it to access was

/home/myuser/dart-sdk

I ran the following using sudo.

sudo flatpak override --filesystem=home com.visualstudio.code

Then I ran vscode again and it was able to read the sdk files…
Checkout:https://www.systutorials.com/docs/linux/man/1-flatpak-override/

Also ref:http://docs.flatpak.org/en/latest/flatpak-command-reference.html?highlight=overrides#flatpak-override

Hope this helps