mason.nvim
mason.nvim copied to clipboard
failed to install java-language-server on Windows
I've searched open issues for similar requests
- [X] Yes
I've manually reviewed logs to find potential errors
- [X] Yes
I've recently downloaded the latest plugin version of mason.nvim
- [X] Yes
Problem description
I failed to install java-language-server via MasonInstall with neovim on Windows.
The output:
▼ Displaying full log
Cloning git repository "https://github.com/georgewfraser/java-language-server.git"…
Cloning into '.'...
From https://github.com/georgewfraser/java-language-server
* tag v0.2.39 -> FETCH_HEAD
/bin/bash: .scriptslink_windows.sh: No such file or directory
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
spawn: pwsh failed with exit code 1 and signal 0.
Expected behavior
Install java-language-server smoothly.
Steps to reproduce
run MasonInstall java-language-server command
Affected packages
mason, java-language-server
Neovim version (>= 0.7)
NVIM v0.9.4 Build type: RelWithDebInfo LuaJIT 2.1.1696883897
Operating system/version
Windows 11
Healthcheck
mason:
- ERROR No healthcheck found for "mason" plugin.
Screenshots or recordings
No response
Hey and thanks for reporting! So for starters the java-language-server unfortunately requires Bash to be installed, even on Windows. It seems like you have Bash installed so that's not the issue. The error output suggests something else is going wrong with path separators being removed (.scriptslink_windows.sh should be ./scripts/link_windows.sh).
I have an idea of what could be wrong, I'll have to test some further the next time I'm on a Windows machine.
The JAVA_HOME environment variable is not defined correctly
Have you set the variable in your environment?
I recommend using :MasonInstall [email protected] from the reference https://github.com/georgewfraser/java-language-server/issues/255
I had the same issue and installing maven with scoop fixed it for me, even with the path separator issue in the link_windows.sh script.
any Update?