Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,35 @@ A Java [language server](https://github.com/Microsoft/vscode-languageserver-prot

Note: This tool is not compatible with [vim-lsp](https://github.com/prabirshrestha/vim-lsp) as it only supports LSPv2.0.

### Emacs (with Eglot)

- Checkout this repository
- Run `./scripts/download_{linux|mac|windows}.sh`
- Run `./scripts/link_{linux|mac|windows}.sh`
- Run `mvn package -DskipTests`
- In Emacs 29+, Eglot is built-in, otherwise you can install it with `M-x package-install eglot`
- Add this configuration to your Emacs init file:
```emacs-lisp
(add-hook 'java-mode-hook #'eglot-ensure)
```
- For older Eglot versions (<= 1.12.29), you'll also need:
```emacs-lisp
(add-to-list 'eglot-server-programs '(java-mode . ("<path-to-java-language-server-dir>/dist/lang_server_{linux|mac|windows}.sh")))
```

Alternatively, for newer versions (>= 1.19), it is sufficient to have a script called `java-language-server` in your `PATH` that launches the actual server. In Linux, this can be done for instance by creating a script in `/usr/local/bin`:
```bash
sudo bash -c 'cat << EOF > /usr/local/bin/java-language-server
#! /bin/sh

<path-to-java-language-server-dir>/dist/lang_server_linux.sh
EOF'

sudo chmod +x /usr/local/bin/java-language-server
```
MacOS and Windows should work similarly.


### KDE Kate

- Checkout this repository
Expand Down