Cannot get jdt-language-server working with helix

I am trying to use jdt-language-server with the helix text editor as the language server for Java. However, almost immediately after I open a Java file in helix, I get the message Language server exited.

if I try running jdt-language-server manually in the command line, it says something like:

An error has occurred. See the log file

When I look at the log file, it says:

!SESSION 2023-10-22 19:16:49.789 -------------------------------------
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  --add-modules=ALL-SYSTEM --add-opens java.base/j
ava.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
Command-line arguments:  --add-modules=ALL-SYSTEM --add-opens java.bas
e/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED

!ENTRY org.eclipse.osgi 4 0 2023-10-22 19:16:50.267
!MESSAGE An error occurred while automatically activating bundle org.e
clipse.jdt.core (44).

[several hundred lines of stack trace omitted]

I have tried setting the -data argument when running jdt-language-server, but it does not appear to do anything.

I was using jdt-language-server as well recently. The version in nixpkgs is outdated.

I had to write a package for it. It now comes with a script called jdtls (emacs uses that by default, maybe helix does same?).

The package I’m using is here:

1 Like

I see. Thanks for the answer!

Would you mind making a PR to nixpkgs to send your changes upstream?

I could at some point, but I already have a bunch of PRs to nixpkgs that have been open for months, so not in any rush to do so.