vscode-java: Windows 10 Couldn't start client Java Language Server even with java_home set

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.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 7
  • Comments: 40 (10 by maintainers)

Most upvoted comments

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

I already have the JAVA_HOME environment variable set - 2

@Manish-Giri Could you try set JAVA_HOME to C:\Program Files\Java\jdk-11.0.1?

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.

Does it happen all the time? I had the same issue just a while ago. Simply restarting VS Code seemed to work.

On Wed, 8 Feb 2023 5:10 am Nawab_furkan, @.***> wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/redhat-developer/vscode-java/issues/785#issuecomment-1421970755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZI7RH26XCMMSQ3U5UKXLN3WWMME7ANCNFSM4GUBQLCQ . You are receiving this because you commented.Message ID: @.***>

thanks, @snjeza. Removing George’s extension worked for me as well.

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.