mason.nvim icon indicating copy to clipboard operation
mason.nvim copied to clipboard

failed to install java-language-server on Windows

Open sangshuduo opened this issue 2 years ago • 5 comments
trafficstars

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

sangshuduo avatar Oct 25 '23 04:10 sangshuduo

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.

williamboman avatar Nov 15 '23 23:11 williamboman

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

Z-xus avatar Jan 05 '24 10:01 Z-xus

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.

SpacewaIker avatar Jan 07 '24 23:01 SpacewaIker

any Update?

doesDeveloper avatar May 07 '24 14:05 doesDeveloper