neovim / nvim-lspconfig

Quickstart configs for Nvim LSP
Apache License 2.0
10.46k stars 2.06k forks source link

jdtls does not work on Windows #416

Closed clemenswasser closed 3 years ago

clemenswasser commented 3 years ago

Features: -acl +iconv +tui See ":help feature-compile"

      System-vimrc-Datei: "$VIM\sysinit.vim"
 Voreinstellung für $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info

- nvim-lsp version(commit hash):
`4f19567fb76438d39ed196ae5b4e06b749e75e16`
- `:checkhealth` result

health#lspconfig#check

Checking language server protocol configuration

health#completion_nvim#check

general

completion source

snippet source

health#nvim#check

Configuration

Performance

Remote Plugins

health#provider#check

Clipboard (optional)

Python 2 provider (optional)

Python 3 provider (optional)

Python virtualenv

Ruby provider (optional)

Node.js provider (optional)

Perl provider (optional)

How to reproduce the problem from neovim startup

init.vim:

call plug#begin(stdpath('data') . '/plugged')

Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/completion-nvim'

call plug#end()

lua require'lspconfig'.clangd.setup{ on_attach=require'completion'.on_attach}
lua require'lspconfig'.jdtls.setup{ on_attach=require'completion'.on_attach}

:LspInstall jdtls

Actual behaviour

Failes to install the jdtls server with the following error message: E5108: Error executing lua Vim:E475: Invalid value for argument cmd: 'sh'is not executable

Even if I install jdtls manually, this error is thrown, when I open a Java file:

E5108: Error executing lua C:\Program Files\Neovim\share\nvim\runtime\lua\vim\lsp.lua:173: cmd: expected list, got nil
stack traceback:
        C:\Program Files\Neovim\share\nvim\runtime\lua\vim\lsp.lua:173: in function '_cmd_parts'
        C:\Program Files\Neovim\share\nvim\runtime\lua\vim\lsp.lua:238: in function 'validate_client_config'
        C:\Program Files\Neovim\share\nvim\runtime\lua\vim\lsp.lua:442: in function 'start_client'
        ...\nvim-data\plugged\nvim-lspconfig\lua\lspconfig\util.lua:261: in function 'add'
        ...im-data\plugged\nvim-lspconfig\lua\lspconfig\configs.lua:177: in function 'try_add'
        [string ":lua"]:1: in main chunk

Expected behaviour

jdtls should install and work on Windows.

ghost commented 3 years ago

I have the same issue. Were you able to fix it by chance?

clemenswasser commented 3 years ago

Unfortunately not.

mjlbach commented 3 years ago

@clemenswasser The issue is sh isn't present on windows, so the LspInstall function fails. Have you tried manually installing the language server? If so, can we update the issue to LspInstall for jdtl does not work on windows? These installers are planned to be deprecated, but it should be easy for someone to make a PR to add conditional logic and powershell commands for installing on windows.

see: https://github.com/neovim/nvim-lspconfig/issues/334