英文:
Changing the java.home path in VS code
问题
我刚刚安装了Java 11,因为VS Code提示我将其更新到Java 11或更新版本。在安装Java 14后,我不知道如何将路径更改为具有Java 14的新文件夹。
在settings.json文件中,当光标悬停在java.home变量上时,可以看到路径。
英文:
I just installed java 11 coz VS code was prompting me to update it to java 11 or newer version. After installing java 14, I'm not getting how to change the path to new folder that has java 14.
In settings.json file the path can be seen when cursor hovered over java.home variable.
答案1
得分: 27
对于现在要进行设置的用户,在VSCode的设置中将"java.home"更改为"java.jdt.ls.java.home"
从
"java.home": "C:\\Program Files\\Java\\jdk-17.0.2"
到
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-17.0.2",
英文:
For those coming now, in VSCode settings change "java.home" to "java.jdt.ls.java.home"
From
"java.home": "C:\\Program Files\\Java\\jdk-17.0.2"
To
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-17.0.2",
答案2
得分: 9
Java开发工具包(Java Development Kit)的路径按照以下顺序进行搜索:
- 在VS Code设置中搜索java.home设置(首先是工作区设置,然后是用户设置)
- JDK_HOME环境变量
- JAVA_HOME环境变量
- 在当前系统路径中
'java.home'具有最高优先级,并且'java.home'与系统环境变量不同。打开设置并搜索'java.home',您可以获得以下示例:
"java.home": "C:\\Program Files\\Java\\jdk1.8.0_161"
它指向的是'jdk'文件夹,而不是'jdkFolder\bin'。
英文:
The path to the Java Development Kit is searched in the following order:
- the java.home setting in VS Code settings (workspace then user
settings) - the JDK_HOME environment variable
- the JAVA_HOME environment variable
- on the current system path
The 'java.home' has the highest priority, and 'java.home' is different from the system environment variable. Open settings and search 'java.home', you can get the example:
"java.home":"C:\\Program Files\\Java\\jdk1.8.0_161"
It points to 'jdk' folder instead of 'jdkFolder\bin'.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论