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 -
I already have the JAVA_HOME
environment variable set -
and also java.home
set in VSCode user settings -
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
- 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)
@Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java
@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:
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.