My system is Linux Mint 18.3 Cinnamon 64-bit.
I've installed IntelliJ-IDEA and Default-jdk (openjdk-8-jdk) using the software manager.
I can see what I believe to be the JDK folder under either /usr/lib/jvm/java-1.8.0-openjdk-amd64
or /etc/java-8-openjdk
when browsing with the file manager (Nemo) or the terminal. But it doesn't matter because IntelliJ can't see either folder anyway. In fact, when trying to Select Home Directory for JDK, IntelliJ only seems to have visibility to 14 sub-folders (out of hundreds) under /usr/lib
.
Not even sure how to launch IDEA from the command-line using sudo
, e.g. to test that the issue is permission-related, since it is apparently being launched vicariously via flatpak.
Seems like this should be simple. I'm not sure what I'm doing wrong.
As others said - sandboxing is a feature, not a bug.
I think @Kevin Dubois' answer should perhaps be preferred where applicable (installing via flatpak the thing you want to share), but there is another solution to this problem if you would like to continue using flatpak
/etc
and /usr
paths in a flatpak:As mentioned at the end of this section of the documentation:
/etc
is mounted at /var/run/host/etc
for the flatpakked software/usr
is mounted at /var/run/host/usr
for the flatpakked softwareNB: It is generally a good idea to give software as little extra access as possible. That's why it is preferable to use the optional :ro
suffix when granting access to a path to make it accessible in read-only. You will also be partly responsible if some software abuses the access it has to your device.
There's some useful path variables in the filesystem permissions reference and a lot of additional information about filesystem permissions here.
Flatseal seems pretty neat.
The examples below are for managing the path /var/lib/gems
for the flatpak app com.jetbrains.IntelliJ-IDEA-Community
.
flatpak info --show-permissions com.jetbrains.IntelliJ-IDEA-Community
sudo flatpak override --filesystem="/var/lib/gems":ro com.jetbrains.IntelliJ-IDEA-Community
sudo flatpak override --nofilesystem="/var/lib/gems" com.jetbrains.IntelliJ-IDEA-Community
sudo flatpak override --reset com.jetbrains.IntelliJ-IDEA-Community
The hint to the mounted directories by @Carolus worked perfectly for me: On my Linx Mint the jdk had been installed within /usr/lib/jvm/java-11-openjdk.
(found by usage of "which java" and using the result with "readlink -e ")
Selected /var/run/host/usr/lib/jvm/java-11-openjdk within the Idea addJdk dialog instead and it works! No change of flatpak permissions was required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With