Skip to content

Provide compatible JDK for JDTLS if none installed #113

@MaddyGuthridge

Description

@MaddyGuthridge

What happened?

My workplace requires me to use Java 17, whereas Jdtls requires Java 21. When I use the Redhat Java extension for VS Code, Jdtls appears to run without issue, presumably by downloading a compatible Java runtime.

What did you expect to happen?

Zed's Java extension also downloads a compatible Java runtime for Jdtls.

I was able to work around this by configuring Jdtls to manually point it to a newer install, but it would be lovely it Zed was able to do this automatically.

  "lsp": {
    "jdtls": {
      "initialization_options": {
        "settings": {
          "java": {
            "home": "/home/maddy/.local/share/mise/installs/java/21.0.2"
          }
        }
      }
    }
  }

Environment

Zed: 0.210.4
Platform: Fedora 42
Java: 17 (installed with Mise)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions