Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jdtls does not work on Windows #416

Closed
clemenswasser opened this issue Nov 19, 2020 · 3 comments
Closed

jdtls does not work on Windows #416

clemenswasser opened this issue Nov 19, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@clemenswasser
Copy link

  • nvim --version:
NVIM v0.5.0-846-g569e5c86b
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe /DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -IC:/projects/neovim/build/config -IC:/projects/neovim/src -IC:/projects/nvim-deps/usr/include -IC:/projects/neovim/build/src/nvim/auto -IC:/projects/neovim/build/include
Übersetzt von appveyor@APPVYR-WIN

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
  - INFO: clangd: configuration checked.
  - ERROR: jdtls: config.cmd error, 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 <C:\Program Files\Neovim\share\nvim\runtime\lua\vim\lsp.lua:172>
    [C]: in function 'pcall'
    ...vim-data\plugged\nvim-lspconfig\lua\lspconfig\health.lua:12: in function 'check_health'
    [string ":lua"]:1: in main chunk

health#completion_nvim#check
========================================================================
## general
  - OK: neovim version is supported

## completion source
  - OK: all completion source are valid

## snippet source
  - INFO: You haven't setup any snippet source.

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: RelWithDebInfo

## Remote Plugins
  - OK: Up to date

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: win32yank

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          python2 not found in search path or not executable.
          python2.7 not found in search path or not executable.
          python2.6 not found in search path or not executable.
          C:\Users\cwasser\AppData\Local\Programs\Python\Python39\python.EXE is Python 3.9 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python in the environment.
  - INFO: Multiple python executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: C:\Users\cwasser\AppData\Local\Programs\Python\Python39\python.EXE
  - INFO: Other python executable: C:/Users/cwasser/AppData/Local/Programs/Python/Python39/python
  - INFO: Python version: 3.9.0

  - INFO: pynvim version: 0.4.2

  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - ADVICE:
      - Install Ruby and verify that `ruby` and `gem` commands work.

## Node.js provider (optional)
  - WARNING: `node` and `npm` (or `yarn`) must be in $PATH.
    - ADVICE:
      - Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.

## Perl provider (optional)
  - WARNING: No usable perl executable found
  • What language server(If the problem is related to a specific language server):
    jdtls
  • Operating system/version:
    Windows 10 1909
  • Terminal name/version:
    PowerShell 7.1.0+Window Terminal Version: 1.4.3141.0
  • $TERM:

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.

@clemenswasser clemenswasser added the bug Something isn't working label Nov 19, 2020
@ghost
Copy link

ghost commented Dec 2, 2020

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

@clemenswasser
Copy link
Author

Unfortunately not.

@mjlbach
Copy link
Contributor

mjlbach commented Dec 18, 2020

@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: #334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants