-
Notifications
You must be signed in to change notification settings - Fork 438
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
incompatible with flatpak: The java.home variable defined in VS Code settings points to a missing folder #510
Comments
Looks like the same issue as with #157. Just to check, can you try to point to a copy of the JDK somwhere under your home directory? |
@fbricon it works fine when point java.home to a copy of the JDK somewhere under home directory. |
I ran into this issue today and wasted quite a lot of time on it :c |
After reading a bit of Flatpak documentation I think this is a problem with the Flatpak package. Checking whether java_home is visible: This is weird, because the file system is set to "host" (meaning the app should be able to access the complete file system ... with weird limitations). There is talk about things being mounted in Anyway, this isn't a problem with vscode-java. I'll post an update when/if I find an acceptable workaround. Edit: I couldn't really find one. Flatpak seems to have system file inaccessability as a design goal, even symlinks don't work. I ended up copying the folder. Feels stupid. |
It also turns out that you can install a JDK and make it visible to a sandboxed application like an IDE with Cheers! |
Maybe it's a bit late, but after reading the docs:
Since settings.json ...
"java.home": "/var/run/host/usr/lib/jvm/java-11-openjdk-amd64"
.... Keep in mind that the real path of the JDK in my filesystem is |
💡 FYI With OpenJDK >11 the following should work: "java.home": "/var/run/host/usr/lib/jvm/default-runtime", Am with Manjaro/Arch. Debian may use a different location. |
I have my dotfiles shared across multiple computers & operating systems. I didn't want my vscode config to have a hardcoded path. So I went with the more machine-specific approach: $ flatpak install flathub org.freedesktop.Sdk.Extension.openjdk11
$ flatpak override --user com.visualstudio.code --env=JAVA_HOME=/usr/lib/sdk/openjdk11/jvm/openjdk-11 Note that the host java didn't work for me. Here's the error when running via the vscode integrated terminal: $ /run/host/usr/lib/jvm/java-11-openjdk/bin/java
/run/host/usr/lib/jvm/java-11-openjdk/bin/java: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /run/host/usr/lib/jvm/java-11-openjdk/bin/../lib/jli/libjli.so) |
As was mentioned a few comments above :
So the JDKs need to be moved to another location or that location needs to be exposed when the VSCode flatpak is running. The only location that might work without any moving is On supported platforms, we ship a JDK (17), though this still doesn't solve the problem for those wishing to use a particular version. |
Hi guys I have opened an issue (and also I proposed a solution) to golang/vscode repo, to resolve this situation. the problem
the links
|
I can propose to you this workaround:
|
[vscode installed by flatpak can not access JAVA_HOME]
I'm not sure is this a bug of vscode-java or flatpack.
Note: flatpak run vscode in a isolated environment.
Environment
Steps To Reproduce
install flatpak: https://flatpak.org
install vscode from: https://flathub.org/apps/details/com.visualstudio.code
install vscode-java and set correct JAVA_HOME/java.home
try to open/run java code
[attach a sample project reproducing the error]
attach logs
Current Result
The java.home/JAVA_HOME variable defined in VS Code settings points to a missing folder
Expected Result
run normal without error.
Additional Informations
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Every thing is OK when run vscode which is installed by .deb file (download from https://code.visualstudio.com/docs/setup/linux).
The text was updated successfully, but these errors were encountered: