New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to configure JDK in Intellij on Fedora Silverblue? #3
Comments
Host applications have nothing to do with Flatpaks. I don't use Java myself it looks like there is a bundled one at |
Hi @fwilhe, I knew this is one of the comments/issues I was expecting ALL the time to show up here 😉 I know it's somehow strange, but with Flatpaks, that kind of workflow changes a little bit; like TingPing said: host applications have nothing to do with Flatpaks. I honestly don't know much technically about Flatpaks, but so far, I can tell you that anything I install in my
** There is also |
thanks for the very quick replies 👍 I solved the issue by manually downloading a openjdk build from https://adoptopenjdk.net/ and putting it into my home directory for now. Not great, but good enough for now. I'd still like to better understand how this works. My mental model of Flatpak is that applications are containerized, similar to Docker, so they don't share the root-fs with my machine, right? This means my issue was not at all related to the use of Fedora Silverblue, would have been the same with Flatpak on any other distro. I assume the home directory is automatically mounted, right? Should I close this issue? From my perspective, at least a good workaround is provided. |
The way I think about it is like that, but @TingPing might have more technical details. And yes, what you are facing here will apply to all other distros as well. I use Arch Linux and it's the same stuff. Again, I would recommend you to use a |
Installing |
I tried installing openjdk via flatpak, but I could not locate it in IntelliJ's file open dialog. Do you know the path I have to look for? |
Thanks for the help, worked for me! But what is the purpose of sandboxing this hard? |
Rewind some years and you would have had the same question(s) about so many things in Linux, in general. Flatpak is somehow starting...and it's looking good so far, you can tell 😉 Eventually, there might be some applications that cannot offer the best experience one can ask for...but good enough for now. Generally speaking, in my opinion, all of this will be improved with time – and sandboxing is great, just break it when you have to 🤣 |
@NeroVanbiervliet Sandboxing makes it portable and secure. Developers don't care about portability or security in their IDEs they just want to get things done. So yea its a weird fit unless a lot of work is put into it. |
Hello @fwilhe |
@x80486 |
What the intent is revolves around protecting your base OS functionality by making it immutable. The immediate benefit to developers is being able to play around with setups in either flatpaks or pet containers, where they have TOTAL control of it's environment, and where if they break something, it has no affect on the host OS. The drawbacks of Docker and it's daemon requirement are avoided in Silverblue with Podman and Buildah, with Skopeo rounding them out with some added utility. This facilitates the fedora-toolbox pet container, which is based on the buildah/podman combo for daemonless containers. The separation of Host OS and App goes even further when you look at updates and how they are applied independently of each other. |
You cannot install openjdk as a flatpak on Fedora Silverblue, you can however layer it with 'rpm-ostree install ', then 'systemctl reboot' to use the new image. Once you have it installed and the system rebooted, you will need to add it to your environment variable $PATH in order for any flatpak you run to access it directly. This can be done for your home dir since you are the owner of any process you start, including a flatpak'd application. |
But they do care about breaking their precious setup. They also seem to care how their app runs wanting the best recommended environment setup for it, which is understandable. Being able to provide their users with consistency across the machines they use it on is how you get more users. The lack of needing to concern the developer with selinux or abstract kernel components, and allowing them to tightly control versioning of their support libraries and not having to rely on or work around missing dependencies at install time should translate into happier users and developers. In practice, like all new things, Silverblue can be a challenge. |
All right, but I don't know how to give you write access to this repository 😕
The choice of
I'm interested to know why would you think using the GNOME platform would be better? Right now the Flatpak does not have a single dependency on anything GNOME-specific, so it can take fully advantage of a slimmer runtime, among other things. You might see GTK |
I forked it and cloned it locally so I can issue a pull request no?
Okay, I wasn't aware of that, I wonder if that means the SDK is a runtime as well? I haven't read that anywhere in any of the documents I reviewed so far for Flatpak's. As for the Gnome platform, I didn't think it was that much larger and gives some extra's if there is someone using Gnome with the IDE. In any case I was more meaning the Platform vs SDK thing, and it built fine with the gnome variation.
I did, it is gone from Gnome 3.x, and I wasn't aware that caused issues with the jetbrains site release of CE. Although, in all fairness, there are plenty other packages using the GTK 2.x lib so I am certain it is installed in the standard Fedora workstation. |
Hi, I was able to get the flatpak to use the extensions using my modified flatpak manifest. The extensions have to be installed in order to use them in the IDE, but I pointed to the openjdk 10 extension and was able to create and compile then run a simple hello world java application after building and installing the IDE. I was going to commit the changes to my fork of your repo. I should then be able to submit a pull request and you can either merge it or not as you see fit. You already have done all the heavy lifting with your IDEA flatpak and I wanted to help since I use IDEA for my Java and JavaFX development projects, and am testing Silverblue out. |
Hello, |
Hello @fwilhe |
I also have the same problem on Fedora Workstation where I have jdk 7,8 and 11 but can't access any of them, it would be great if we could allow a file or folder to be used by the app as I don't want to install JDK again separately for flatpak app. |
If you are using Fedora Workstation (proper) as opposed to Silverblue or Atomic Host it should be merely a point of making the correct configuration settings in the IDEA IDE for libraries and runtimes, even if you are running the IDE in a flatpak. On Silverblue, openjdk 9 Extension from Flathub fails to run for, it's directory is seen by the IDEA ide as not having any java SDK, even though it appears to be similar or the same as openjdk 10 Extension for example. Plus versions of JDK's prior to 9 are not built as extension for the flatpak apps. Also, it is important to remember the Workstation Fedora is a standard Linux workstation, and has a directory structure that is known by all, while Silverblue has an immutable os (rpm-ostree) and it has only /var and /etc as writable, with root (/) being immutable. When the image of the OS is mounted it binds /usr to /var/usr and /home to /var/home, and on. What this means in practice is that when you cd into /usr/lib you are actually in /var/usr/lib in |
@TheOneandOnlyJakfrost I have openjdk 7, 8 and 11 installed in |
If you are referring to the extensions, you can find them from the terminal with the command |
If you are running Silverblue, and you are meaning for the library of your jdk that you configure in IDEA's project structure, then mine which were installed by the extensions mentioned are located here for jdk 11 |
I have Fedora Workstation and I would like to use the one installed with package manager |
Okay, So on workstation the jdk's reside in /usr/lib/jvm/java-11-openjdk for openjdk 11 which is a symlink to the directory. The jre is a symlink shown as jre-11. At least that is how I see it in my pet container. If you look in that /usr/lib/jvm directory you will see another directory (or more depending on how many jdks you installed) that will have an immensly long filename, usually with rolling and fc29 somewhere in the name along with openjdk. Hope that helps. |
Yes, that is what I was referring to earlier, I can't access that directory from IDEA, I don't see |
I can't use debugger from IDE as well maybe because internal JRE does not have permission to pick process from outside? Running maven project from home directory |
This discussion has largely strayed from the original issue, perhaps we could move it to a more appropriate forum, like https://discussion.fedoraproject.org/top and You could present your topic there. This would have the added benefit of others who may be currently experiencing the same issues, joining with us to find your solution. |
I've faced this problem with ordinary Intellij installs in the past. In that case I made my own script to set things likd JAVA_HOME, M2_HOME, etc that don't get exported into the GUI environment. Not sure it is feasible to have your own custom script wrapper with a flatpak. |
For all those doing Java(Scala, Kotlin) development, I would recommend SdkMan! The superhero that we all need, and some might even deserve. Using SDK man, you have fine control over which versions of JVM you install, which version you use as default, and how they all interact. All within user space. |
IntelliJ IDEA version |
Hello,
I'm trying out Fedora Silverblue, and I don't get IntelliJ configured with an 'sdk' (in IntelliJ terms, so the openjdk dev environment).
rpm-ostree
rpm-ostree install java-11-openjdk-devel
flatpak install flathub com.jetbrains.IntelliJ-IDEA-Community
Open jdk is available in
/usr/lib/jvm/java-openjdk/bin/
Still, when I start IntelliJ, and try to create a new project, I can't configure this JDK. I don't find the
jvm
dir in/usr/lib
. I guess this is due to how flatpak works, but I'm not sure if I understand that well enough.Can some one explain what I need to do, and how flatpak and rpm-ostree integrate?
The text was updated successfully, but these errors were encountered: