flathub / flathub/com.visualstudio.code

JDK 11+ Language Server cannot find PATH

未关闭
#284 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Shell
星标
217
派生
82
平均合并
1 天 7 小时
30 天内合并 PR
1

描述

Hi everyone,

So I downloaded a JDK package for Java development, set the JAVA_HOME path for it in the bottom of the .bashrc file like so:

JAVA_HOME = /usr/lib/sdk/openjdk11/jvm/openjdk-11
export JAVA_HOME
export PATH=$PATH:$JAVA_HOME

I then went into VSCODE and set the path inside the settings.json file like so:

"java.configuration.runtimes": [
{
"name": "JavaSE-11",
"path": "/usr/lib/sdk/openjdk11/jvm/openjdk-11",
"default": true
},
{
"name": "JavaSE-17",
"path": "/usr/lib/jvm/java-17-oracle",

},
],

"java.jdt.ls.java.home": "/usr/lib/sdk/openjdk11/jvm/openjdk-11",

However, VSCODE throws an error and says "The java.home variable defined in Visual Studio Code settings points to a missing or inaccessible folder (/usr/lib/sdk/openjdk11/jvm/openjdk-11)" even though that is the correct path. It does not work with java-17 either, and I downloaded the files from oracle themselves.

I think this is an issue only for the flathub version of VSCODE, because other forums says that the one from snap works fine.

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先,使用 settings.json 中的路径以及 .bashrc 中的 JAVA_HOME/PATH 条目,复现 Flathub VS Code 软件包中缺少文件夹或无法访问文件夹的错误。检查打包的应用程序如何访问这些 JDK 目录,并比较 Java 11 和 Java 17 的配置。当 Java 语言服务器在 Flathub 构建中接受有效配置的 JDK 路径时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, shell, vscode
领域
desktop, devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。