October 22, 2024
Chicago 12, Melborne City, USA
java

VSCode Oracle Language Server errors out


I recently installed the Java 23 JDK on my computer, and I went to VSCode in order to update the Java version it uses. However, I found it already broken.

When opening my Java project, I saw an error popup saying Error initializing Oracle Java SE Language Server not enabled.

In the associated terminal window, I found the following log:

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-23.jdk/Contents/Home and userdir /Users/rahulchoubey/Library/Application Support/Code/User/workspaceStorage/bc14dfd84ed7c4f7a6d495fae3d0d875/Oracle.oracle-java
LSP server launching: 3851
LSP server user directory: /Users/[username]/Library/Application Support/Code/User/workspaceStorage/bc14dfd84ed7c4f7a6d495fae3d0d875/Oracle.oracle-java
There are parameters but nobody wants to proces them: [Course, Files]
Cannot find org.netbeans.modules.java.lsp.server in the log!
Please refer to troubleshooting section for more info: https://github.com/oracle/javavscode/blob/main/README.md#troubleshooting
Request to kill LSP server.
Cannot kill: Requested kill on 3851, current process is None
Oracle Java SE Language Server not enabled

(The [username] is just a stand-in for my username.)

Based on the "parameters" message, the error might be that my folder name has a space in it, but it did not cause any problems before—the errors only started yesterday.

The relevant values in the settings.json file are as follows:

{
    …,
    "java.configuration.runtimes": [
        {
            "name": "JavaSE-23",
            "path": "/Library/Java/JavaVirtualMachines/zulu-23.jdk/Contents/Home",
            "sources": "/Library/Java/JavaVirtualMachines/zulu-23.jdk/Contents/Home/lib/src.zip",
            "default": true
        },
    ],
    "java.jdt.ls.java.home": "/Library/Java/JavaVirtualMachines/zulu-23.jdk/Contents/Home",
}

I don’t believe the error is Netbeans-related, as I don’t have that installed, and the extension worked just fine until now. The "troubleshooting" section only suggested clearing the cache, which does nothing.

One solution I’ve considered is renaming my project directory to have underscores; however, most of its subdirectories also have spaces in their names, so I’m not sure whether that solution is advisable.

(I searched here, but I only found this question. The only answer there was to install a JDK, and I’m not getting a "JDK not found!" popup along with the error.)



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video