Working with Java in Emacs (yet again)

There are a couple of legacy Java services at work that I have to do maintenance on every once in a while. I haven’t really kept up with the state Java for the past few years, so my approach goes something like “change as little as possible and pray for minimal breakage”.

I used to rely on eclim back in the day, and am apparently still the top contributor to the emacs-eclim project even though I threw in the towel back in 2014. Emacs-eclim was kind of cool, but suffered from a few serious drawbacks: 1) you still had to maintain an entire Eclipse installation locally (which tended to rot away if left untended), and 2) for the longest time there was only one guy working on the Emacs side of things.

There is now a far better solution though: use LSP mode with the Java backend. It’s like emacs-eclim but better in every possible way. There is a well-defined protocol for communicating between the editor frontend and language server backend, which has been adopted across many languages and editors. A community-driven project is a big deal.

As far as I can tell, there is still a headless Eclipse server running, but LSP Mode handles installation and maintenance, so you never need to bother with that stuff. UI response time is decent, and my emacs behaves kind of like an IDE when I need it to. I like it; it makes my excursions into Javaland at least bearable.