Skip to content

Add basic Emacs configuration instructions#336

Open
bertulli wants to merge 2 commits intogeorgewfraser:masterfrom
bertulli:emacs-doc
Open

Add basic Emacs configuration instructions#336
bertulli wants to merge 2 commits intogeorgewfraser:masterfrom
bertulli:emacs-doc

Conversation

@bertulli
Copy link

Hi, thanks for your work. i just set up the server in my Emacs and i thought it could have been useful to share the configuration needed

@brown
Copy link
Contributor

brown commented Nov 30, 2025

Setting eglot-server-programs is no longer needed with newer versions of Emacs. Just make sure that a script named java-language-server is somewhere in your PATH and that the script starts up the language server.

@bertulli
Copy link
Author

bertulli commented Dec 6, 2025

thanks! do you remember when/in which version of Eglot this was introduced? it was done by setting the default value of the variable eglot-server-programs. i see that in 1.12.29 there was not, and in 1.19 there is

@brown
Copy link
Contributor

brown commented Mar 11, 2026

Here's one more thing you'll want to do when using Emacs/Eglot with java-language-server.

The language server sends "jar://" URIs to Emacs when the server knows a Java source file is present inside a source jar file. For me this typically happens when I'm editing a Java file and use xref-find-definitions on a class or method whose source exists in a source jar that Maven copied to my machine. In order to make the command work, Emacs needs to extract a file from the jar. To add that capability to Emacs, download the jarchive package and ensure the jarchive-setup function has been called before Eglot has started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants