[BUG] LSP goToDefinition should support jdt:// URIs for Java jar dependency navigation

Resolved 💬 3 comments Opened Mar 24, 2026 by adhi97 Closed May 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using the Java language server (jdtls) through Claude Code's LSP integration, goToDefinition cannot navigate into classes that live inside jar dependencies. It returns "No definition found."

The hover operation works fine for these same symbols. It correctly identifies the type and its source jar. The problem is only with goToDefinition.

Root Cause:
When you call goToDefinition on a symbol from a jar dependency, jdtls returns a location with a jdt:// URI instead of a file:// URI. This is a custom URI scheme that jdtls uses to represent
class files inside jars. Claude Code's LSP client does not recognize this scheme, so it reports no definition found.

VSCode handles this by:

  1. Recognizing the jdt:// URI in the goToDefinition response
  2. Sending a java/classFileContents request back to jdtls to get the decompiled source
  3. Displaying the decompiled source as a read-only virtual file

The decompiler (FernFlower) is already bundled with jdtls. No extra setup is needed on the server side. The only missing piece is client-side handling of the jdt:// URI

What Should Happen?

goToDefinition on a jar class should return the decompiled source of that class, similar to how VSCode and other editors handle it.

Java projects rely heavily on external libraries. Without jar navigation, Claude Code cannot inspect dependency APIs, understand return types, or verify method signatures. This forces workarounds like manually unzipping jars or maintaining documentation files with dependency APIs.

This would be a big improvement for all Java users of Claude Code.

Error Messages/Logs

Steps to Reproduce

  1. Set up a Java project with jdtls as the LSP server (via a plugin)
  2. Open a file that imports a class from a jar dependency (not project source)
  3. Run goToDefinition on that class name
  4. Result: "No definition found"
  5. Run hover on the same symbol
  6. Result: correctly shows the fully qualified class name and source jar

Claude Model

None

Is this a regression?

No

Last Working Version

_No response_

Claude Code Version

2.1.81

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗