Shlok V
Shlok V

Reputation: 31

Unable to install java-language-server with mason lsp-zero

I am using lsp-zero which uses mason to install everything but whenever I try to install java-language-server I get the error.

Any help is appreciated.

Whenever i do :LspInstall and choose the first option it shows this

\[8/8\] spawn: bash failed with exit code 127 and signal 0.

I already tried installing diff versions of java-language-server but didn't work.

Upvotes: 3

Views: 4644

Answers (2)

Issasafar
Issasafar

Reputation: 23

try to setup your JAVA_HOME and PATH variables, it you didn't, i had the same problem this is because you may have an old java version that is not supported by the lsp i guess, so you have to download jdk-17 or older and setup those variables.

Upvotes: 0

cminusminus
cminusminus

Reputation: 55

Unsure if you've resolved this but I'll comment for others searching for answers.

Whenever I run into trouble installing lsp on a new nvim setup, the issue tends to be related to me not having a dependency installed.

Things to try:

  • Install/Update Java
  • Change the permissions for bash on your zsh (chmod +x /bin/bash)
  • Check you have all dependencies installed for java-language-server
  • Use jdtls instead

Upvotes: 2

Related Questions