Reputation: 23
When I open a java project located in my wsl in Visual Studio Code, I get the error "Couldn't start client Language Support For Java". I have tried setting the JAVA_HOME environmental variable in wsl. Currently is is set to /mnt/c/path/to/parentfolder/jdk-18.0.1. I also set JAVA_HOME to the same directory in Windows, and VSCode is able to find it properly there. I also tried cleaning the java language server workspace. What should I try next?
Edit: I was mistaken that it's caused by wsl in general. It appears to be linked to a particular project in my wsl and other projects are working.
Upvotes: 0
Views: 3601
Reputation: 23
It turns out that the difference in behavior between the two projects was in how I was accessing the folder. I have my wsl mounted as a network drive, and opening Z:\etc on VS Code works. Opening \wsl$\etc or opening a folder by invoking code from the command line does not work.
Upvotes: 2