Setting up Helix for Java Maven Projects

I don't use Java very often, so my tooling around that language is fairly basic. But today I was looking at the Planetiler project and needed proper IDE features to explore it.

My editor of choice for a long time has been Helix. It supports the standard Java LSP JDTLS out of the box and gives you most of the LSP features you'd expect.

When trying to understand any new codebase, I like to explore the actual source code, and a very useful LSP feature for that is the "Go to Definition" which lets you jump to the definition of any symbol. There are a few steps required to make it work for a Maven Java project.

First, you need to explicitly ask Maven to download the source JARs for your dependencies, not just the compiled artifacts. Otherwise, there is no code to jump to.

mvn dependency:sources

This will download the *-sources.jar files next to the compiled artifacts in your local Maven repository. But, those sources are packaged as archives. As such, JDTLS returns a special URI scheme jdt:// to the editor, rather than a link to a regular file. Helix doesn't know how to handle that scheme and the maintainers do not want to add support for any nonstandard LSP extensions.

Fortunately, Quan Tong wrote a tiny LSP wrapper for exactly this use case in 2025 (see also his blog post where he goes into detail on how he debugged it). Following the documentation, I installed it and configured it in Helix's language.toml as follows:

[[language]]
name = "java"
language-servers = [ "jdtls" ]
indent = { tab-width = 4, unit = "    " }

[language-server.jdtls]
command = "jdtls-wrapper"

[language-server.jdtls.config]
java.inlayHints.parameterNames.enabled = "all"
extendedClientCapabilities.classFileContentsSupport = true

And it works just fine. I can finally jump around all that Java code.