Java 我无法在 Visual Studio Code 上设置 JDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52539414/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
I can't set up JDK on Visual Studio Code
提问by ?mran Durmu?
I saw this:
我看见了这个:
clicked on it, it redirected me to Red Hat site and made me download Red Hat Developer Studio, but as I said I want it in Visual Studio Code. I did download JDK, but don't know what to do next.
单击它,它将我重定向到 Red Hat 站点并让我下载 Red Hat Developer Studio,但正如我所说,我希望在 Visual Studio Code 中使用它。我确实下载了JDK,但不知道下一步该怎么做。
回答by amirali
- Press Ctrl+comma.
- Search for "java.home".
- 按Ctrl+ comma。
- 搜索“java.home”。
In case you are on the newest vscode version:
如果您使用的是最新的 vscode 版本:
- Type in your java path(Don't forget to put the path in
" "
).*
- 输入您的 java 路径(不要忘记将路径放入
" "
)。*
In case you are on an older version of vscode:
如果您使用的是旧版本的 vscode:
- Click on the pencil next to the line starting with "java.home".
- click on "Copy to settings".
- Type in your java path(Don't forget to put the path in
" "
).* - Press Ctrl+S.
- 单击以"java.home"开头的行旁边的铅笔。
- 点击“复制到设置”。
- 输入您的 java 路径(不要忘记将路径放入
" "
)。* - 按Ctrl+ S。
*If you don't know your java path, type in which java
in your terminal(On windows, Please note the right format, e.g: "java.home": "C:/Program Files/Java/jdk-11.0.2"
)
*如果你不知道你的java路径,请在which java
您的终端(在Windows上,请注意正确的格式,如:"java.home": "C:/Program Files/Java/jdk-11.0.2"
)