Skip to content

Windows 10 Couldn't start client Java Language Server even with java_home set #785

Closed

Description

@Manish-Giri

When I open a java project in VSCode and click on a .java file, I get the error - "Couldn't start client Java Language Server". Screenshot below -

1

I already have the JAVA_HOME environment variable set -

2

and also java.home set in VSCode user settings -

3

Environment
  • Operating System: Windows 10
  • JDK version: 11.0.1
  • Visual Studio Code version: 1.30.2
  • Java extension version: 0.38.0
Steps To Reproduce
  1. Open a java file in a java project
Additional Informations

I also get additional errors, like "Classpath is incomplete". Even though I opened a complete intellij generated project and a netbeans generated project in 2 different windows.

Activity

  1. quiles909 commented on Sep 28, 2020

    @quiles909

    Side note: I was getting this error as well and triple checked everything above for env variables, etc...

    The key for me was to launch VSCode as an admin. At that point, everything started working.

    Frustrating because setup/install specifically recommended NOT running install as an admin.
    #785
    Hope this helps.

    I had the same issue here like everyone else, and opening VS Code as an Admin, the message about not starting java Language is no more. Not sure how else to run VS Code Java not as Admin and prevent the message from showing or how to fix it?

  2. quiles909 commented on Sep 28, 2020

    @quiles909

    @Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java

    That worked, thanks!

  3. djkong7 commented on Oct 2, 2020

    @djkong7

    I am having the same issue.

    Brand new install of Windows 10.

    JAVA_HOME: "C:\Program Files\AdoptOpenJDK\jdk-11.0.8.10-hotspot"

    1. Open the command palette (F1)
    2. select Developer: Toggle Developer Tools

    [[object Object]]Internal error.

    and

    Error: Internal error.
    at c:\Users\djkong7.vscode\extensions\redhat.java-0.68.0\dist\extension.js:1:76464
    at c:\Users\djkong7.vscode\extensions\redhat.java-0.68.0\dist\extension.js:1:76758
    at Immediate. (c:\Users\djkong7.vscode\extensions\redhat.java-0.68.0\dist\extension.js:1:77117)
    at processImmediate (internal/timers.js:439:21)

    These two errors are logged thousands of times.

    I can't try "remove the georgewfraser.vscode-javac extension and install RedHat vscode-java -" because I've never had it installed.

    Also tried to launch VSCode as admin. No luck.

    Upon further searching, I found #1588 . Maybe someone here has some ideas.

  4. snjeza commented on Oct 2, 2020

    @snjeza
    Collaborator

    @djkong7 Could you attach your settings.json?

  5. djkong7 commented on Oct 2, 2020

    @djkong7

    @snjeza Yeah! Here you go.

    {
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "terminal.integrated.shell.windows": "C:\Program Files\PowerShell\7\pwsh.exe",
    "java.trace.server": "verbose",
    "java.configuration.checkProjectSettingsExclusions": false
    }

  6. snjeza commented on Oct 2, 2020

    @snjeza
    Collaborator

    @djkong7 Could you try to add:

    "java.home": "C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.8.10-hotspot",
    

    backslashes must be escaped (duplicated)

  7. djkong7 commented on Oct 2, 2020

    @djkong7

    @snjeza Looks like I'm still having the same issue. New settings.json:

    {
        "editor.suggestSelection": "first",
        "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
        "terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
        "java.trace.server": "verbose",
        "java.configuration.checkProjectSettingsExclusions": false,
        "java.home": "C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.8.10-hotspot"
    }

    same errors as before. Here is a screenshot of my Java Runtime Configuration.
    image

  8. snjeza commented on Oct 2, 2020

    @snjeza
    Collaborator
  9. djkong7 commented on Oct 2, 2020

    @djkong7

    Same issue and same error messages after following the steps:

    Open the command palette (F1)
    select Java: Clean the Java language server workspace
    click Restart and delete

  10. snjeza commented on Oct 2, 2020

    @snjeza
    Collaborator

    @djkong7 could you attach your logs:
    %APPDATA%\Code\User\workspaceStorage<your_workspace>\redhat.java - whole this directory

  11. djkong7 commented on Oct 2, 2020

    @djkong7

    @snjeza So %APPDATA%\Code\User\workspaceStorage<your_workspace>\redhat.java is around 7.5GB. I backed up that folder and restarted VSCode to get a new folder that should hopefully have the same error logs in it, just much smaller.
    redhat.java.zip

    I was able to zip the original folder and get it down to 400MB. 15MB with 7zip if you'll accept that.

  12. snjeza commented on Oct 2, 2020

    @snjeza
    Collaborator

    @djkong7 could you try to move your project to C:<some_directory> and try to open it?

  13. djkong7 commented on Oct 2, 2020

    @djkong7

    @snjeza That seemed to work! Is running projects that reside in \\wsl$ something that is officially not supported?

  14. snjeza commented on Oct 2, 2020

    @snjeza
    Collaborator
  15. djkong7 commented on Oct 2, 2020

    @djkong7

    @snjeza Ahh, gotcha. I guess it gets confusing when to use that or not since you can now browse WSL files natively in windows explorer. Thank you for your help!

  16. bhaskor-sarmah commented on Oct 24, 2020

    @bhaskor-sarmah

    georgewfraser

    Thanks buddy, this solved my issue also.

  17. anhLEvn commented on Aug 8, 2021

    @anhLEvn

    @Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java

    That worked, thanks!

    @Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java

    It worked. Great thanks!

  18. skorhone commented on Oct 8, 2021

    @skorhone

    I had exactly the same problem that @djkong7 had. Project that I'm working on is located on WSL2, but I needed to run it on Windows (Firewall was blocking traffic from wsl2. wsl2 and workstation firewalls are just a big mess :-/)

    There's a simple workaround for the problem where language server fails compiling source code from UNC paths ( \wsl$\foo = UNC path)

    Open \\wsl$\ in File Explorer. Right click on the WSL2 installation and select Map network drive.... Finally open project from the mapped drive in VS Code.

  19. chehab2003 commented on Nov 30, 2021

    @chehab2003

    Hello @snjeza I am facing the couldn’t start client java Language server do you know how to fix this?

  20. RamiSJ12 commented on Feb 25, 2022

    @RamiSJ12

    @chehab2003
    I just uninsstalled java enviroment aqnd extentions then install again and restart, will work properly, becaue now VSC has better API to dedct your bug.

  21. Hamzy-Ab commented on Nov 9, 2022

    @Hamzy-Ab

    Side note: I was getting this error as well and triple checked everything above for env variables, etc...

    The key for me was to launch VSCode as an admin. At that point, everything started working.

    Frustrating because setup/install specifically recommended NOT running install as an admin.

    Hope this helps.

    Worked like magic. Thanks man.

  22. mohdfurkan01 commented on Feb 8, 2023

    @mohdfurkan01

    When I open a java project in VSCode and click on a .java file, I get the error - "Couldn't start client Java Language Server".
    I am facing the same problem what can I do?

  23. Hamzy-Ab commented on Feb 8, 2023

    @Hamzy-Ab
  24. RokE03 commented on Mar 9, 2023

    @RokE03

    I happened to solve my instance of this issue by editing the settings.json:

    I found following:
    "java.jdt.ls.java.home": ",

    After adding my openjdk-directory on this parameter, the error didn't show up anymore.

  25. mohdfurkan01 commented on Mar 9, 2023

    @mohdfurkan01

    I happened to solve my instance of this issue by editing the settings.json:

    I found following: "java.jdt.ls.java.home": ",

    After adding my openjdk-directory on this parameter, the error didn't show up anymore.

    ok I will check it....and thanks for the help & support

  26. robstryker commented on Nov 2, 2026

    @robstryker
    Contributor

    This issue seems to have had a lot of individual causes, and a lot of different solutions. At this point I think it's best to close this issue and let others open new ones for their specific situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions