Skip to content

Commit 3afa1f7

Browse files
awbertulligeorgewfraser
authored andcommitted
Add clarification about new Eglot default integration
1 parent 57ee88f commit 3afa1f7

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,24 @@ Note: This tool is not compatible with [vim-lsp](https://github.com/prabirshrest
3232
- In Emacs 29+, Eglot is built-in, otherwise you can install it with `M-x package-install eglot`
3333
- Add this configuration to your Emacs init file:
3434
```emacs-lisp
35-
(add-to-list 'eglot-server-programs '(java-mode . ("<path-to-java-language-server>/java-language-server/dist/lang_server_{linux|mac|windows}.sh")))
3635
(add-hook 'java-mode-hook #'eglot-ensure)
3736
```
37+
- For older Eglot versions (<= 1.12.29), you'll also need:
38+
```emacs-lisp
39+
(add-to-list 'eglot-server-programs '(java-mode . ("<path-to-java-language-server-dir>/dist/lang_server_{linux|mac|windows}.sh")))
40+
```
41+
42+
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`:
43+
```bash
44+
sudo bash -c 'cat << EOF > /usr/local/bin/java-language-server
45+
#! /bin/sh
46+
47+
<path-to-java-language-server-dir>/dist/lang_server_linux.sh
48+
EOF'
49+
50+
sudo chmod +x /usr/local/bin/java-language-server
51+
```
52+
MacOS and Windows should work similarly.
3853

3954

4055
### KDE Kate

0 commit comments

Comments
 (0)