我在 VSCode(版本:1.85.0 - MacOS Ventura)上安装了 Oracle Java Platform Extension for Visual Studio Code,并按照我添加到 settings.json 的说明操作
"jdk.jdkhome": "/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents" (using the provided JDK downloader) and
"jdk.userdir": "global"
然后我重新启动 VSCode 并尝试 Java: New Project 命令。 我得到的输出如下:
Initiating server activation
Request to kill LSP server.
Cannot kill: current process is None
Launching Oracle Java SE Language Server with /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents and userdir /Users/c11886/Library/Application Support/Code/User/globalStorage/oracle.oracle-java
LSP server launching: 49560
LSP server user directory: /Users/c11886/Library/Application Support/Code/User/globalStorage/oracle.oracle-java
Cannot find java. Please use the --jdkhome switch.
Cannot find org.netbeans.modules.java.lsp.server in the log!
Request to kill LSP server.
Cannot kill: Requested kill on 49560, current process is None
Oracle Java SE Language Server not enabled!
知道我做错或错过了什么吗?
您需要安装Java开发工具包(JDK)才能在您的设备中运行它进行开发。
根据您的操作系统下载 JDK,它就可以工作了!!
我在 ubuntu 24 中安装了 java-23 jdk,但仍然收到此错误。我一打开vscode就出现这种情况