java-language-server icon indicating copy to clipboard operation
java-language-server copied to clipboard

Mason unable to install Java Language Server

Open V4G4X opened this issue 2 years ago • 15 comments
trafficstars

New to vimming.
Have installed Mason, usually it installs LSPs without a hitch.

Get the following error when it tries to install the Java LSP:

Failed (1)
  ◍ java-language-server
    ▼ Displaying full log
      Cloning into '.'...
      From https://github.com/georgewfraser/java-language-server
       * tag               v0.2.39    -> FETCH_HEAD
      + ./scripts/link_mac.sh
      + mvn package -DskipTests
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ---------------------< org.javacs:javac-services >----------------------
      [INFO] Building javac-services 0.1-SNAPSHOT
      [INFO]   from pom.xml
      [INFO] --------------------------------[ jar ]---------------------------------
      [INFO]
      [INFO] --- resources:3.3.0:resources (default-resources) @ javac-services ---
      [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory /Users/varungawande/.local/share/nvim/mason/.packages/java-language-server/src/main/resources
      [INFO]
      [INFO] --- compiler:3.8.0:compile (default-compile) @ javac-services ---
      [INFO] Changes detected - recompiling the module!
      [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
      [INFO] Compiling 357 source files to /Users/varungawande/.local/share/nvim/mason/.packages/java-language-server/target/classes
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  0.560 s
      [INFO] Finished at: 2023-05-07T12:47:39+05:30
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project javac-services: Fatal error compili
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      spawn: bash failed with exit code 1 and signal 0.

Here is my java and maven versions.

❯ java -version
openjdk version "11.0.19" 2023-04-18 LTS
OpenJDK Runtime Environment Microsoft-7621296 (build 11.0.19+7-LTS)
OpenJDK 64-Bit Server VM Microsoft-7621296 (build 11.0.19+7-LTS, mixed mode)
❯ mvn -v
Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /Users/varungawande/.sdkman/candidates/maven/current
Java version: 11.0.19, vendor: Microsoft, runtime: /Users/varungawande/.sdkman/candidates/java/11.0.19-ms
Default locale: en_IN, platform encoding: UTF-8
OS name: "mac os x", version: "13.3.1", arch: "aarch64", family: "mac"

In case we don't know what the error is, where can I find the logs to figure out what went wrong?

V4G4X avatar May 07 '23 07:05 V4G4X

I made the same mistake, even if I changed the maven version.

cnxjk avatar May 10 '23 02:05 cnxjk

I tried pulling down java-language-server for manual compilation, but the problem persisted.

cnxjk avatar May 10 '23 02:05 cnxjk

I got the same mistake

byteboycn avatar May 10 '23 06:05 byteboycn

I installed other version, its worked, the command is :MasonInstall [email protected]

byteboycn avatar May 10 '23 06:05 byteboycn

same

DaydreamerHW avatar May 12 '23 15:05 DaydreamerHW

same too

wgkflyit avatar Jun 23 '23 06:06 wgkflyit

I also had the same issue

optimistarby-sn avatar Jun 28 '23 15:06 optimistarby-sn

Even I had the same issues while installing with Mason.

Image attached for reference. image

0xatulpatil avatar Jul 01 '23 18:07 0xatulpatil

I installed other version, its worked, the command is :MasonInstall [email protected]

Even tried this. @byteboycn

image

0xatulpatil avatar Jul 01 '23 18:07 0xatulpatil

I'm getting the same error:

      ✗ java-language-server
      ▼ 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
        + ./scripts/link_linux.sh
        ./scripts/link_linux.sh: line 12: jlink: command not found
        spawn: bash failed with exit code 127 and signal 0.

NINNiT avatar Jul 10 '23 14:07 NINNiT

same too

update jdk version to the newest can solve this problem

wgkflyit avatar Jul 13 '23 02:07 wgkflyit

Updated to java 20, still getting that error

same too

update jdk version to the newest can solve this problem

abhemanyus avatar Jul 16 '23 12:07 abhemanyus

Updated to java 20, still getting that error

same too

update jdk version to the newest can solve this problem

Nevermind, I messed up and installed jre 20 instead of jdk 20. Its working now, thanks!

abhemanyus avatar Jul 16 '23 13:07 abhemanyus

Even for me I fixed the issue by installing openjdk 17.0.7 but I wonder what the cause must be.
The older JDK11 did have the jlint binary in the PATH.

Forcing people to upgrade to the latest JDK is hardly the right solution, especially for Java users.
Must be a better way to solve this.

V4G4X avatar Jul 29 '23 07:07 V4G4X

this is how i fix:

install sdkman

curl -s "https://get.sdkman.io" | bash

install openjdk (eclipse)

sdk install java 21.0.1-tem

install maven

sdk install maven

maxmx03 avatar Dec 20 '23 11:12 maxmx03

hello,I had the same problem at first, but after I updated the jdk version to dk22, I was able to install it successfully. Here is my version of the environment. image image image I hope this help you.

ZqurGy avatar May 03 '24 03:05 ZqurGy

I'll be closing this issue as the README says that Java 13 is the minimum version required for this.
And upgrading is fixing it for everyone else.

If you're facing trouble due to another reason, please open another issue.

V4G4X avatar May 03 '24 15:05 V4G4X