Never start Emacs Eglot for a Java project without a .git/ directory.
This drove me nuts now a second time. Without the .git/ directory, eglot doesn't know where the project's root directory is. Eclipse-jdtls goes all stupid, ignores .classpath, .project and all the package names are marked as wrong.
There are surely ways to tell Eglot where the project root is, but in the end there will be git anyway. Just don't to start your project without. π
Eglot and eclipse-jdtls, a dream team.
Jdtls sends a non-standard message "language/eventNotification ... Preview features enabled at an invalid source release level 21", non-standard insofar as it is not mentioned in the LSP-specification: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
At least Eglot lists the message in its message buffer.
Even me reading the message did not reckon it means: WE'RE ALL SCREWED UP, but keep running and pretend to be OK.
Rant: Eclipse for Java
I avoid Gradle or Maven. The source setup is like Gradle though
- src/main/java
- src/test/java
and I have a few jars in ./lib . Project import gives me
- a project which is not Java
- main.java as package prefix
But worst: even in 2025 it seems impossible to tell eclipse: use all fucking jars in ./lib on the classpath. WTF.
Ultra-worst: using the jdtls requires to set up the project in eclipse, otherwise it goes ballistic.
A few days ago the maintainers of #homebrew accepted my contribution to bring #eclipse #languageserver a.k.a. #jdtls to this #packagemanager.
However, the workflow of accepting a #contribution in #homebrew is weird and frankly a bit disrespectful because my authorship is lost (I'm not even a commiter anymore).
Who can tell which of my PRs got accepted without looking into all comments? https://github.com/Homebrew/homebrew-core/pulls?q=is%3Apr+jdtls