Skip to content

Language server jdtls: from extension "Java" version 6.8.2: No such file or directory (os error 2) #155

Closed

Description

@AllieKatte

Relevance Confirmation

  • I confirmed that this is not an issue with the Eclipse JDT Language Server itself

What happened?

Hi! I'm so so sorry if this isn't the right place to ask this or if I'm just doing something wrong, I'm a beginner and I've been trying to set up the java extension for quite a while, and I keep getting this error:

Language server jdtls:

from extension "Java" version 6.8.2: No such file or directory (os error 2)

I read through the instructions and I did double check just to make sure that JAVA_HOME was set and that java was on my path, and I don't see any problems with that, but just in case it's helpful this is what they are both set to in my environment:

❯ echo $JAVA_HOME
/home/allie/.local/share/mise/installs/java/temurin-21.0.9+10.0.LTS
❯ which java
/home/allie/.local/share/mise/installs/java/temurin-21.0.9+10.0.LTS/bin/java

I've tried it both with Java 25 originally, and then also with Java 21, and neither one was working so I'm not sure if I'm just doing something wrong. I know it isn't a problem with jdtls itself because when I look in the java extension directory it hasn't even been downloaded (and I might have misunderstood, but I thought that the extension does that automatically by default), and I've tried looking through other issues to see if I could get any hints, but I'm not really sure what to do now.

❯ ls -la ~/.local/share/zed/extensions/work/java/
drwxr-xr-x allie allie 12 B Sat Dec 20 15:15:03 2025 .
drwxr-xr-x allie allie 44 B Sat Dec 20 17:27:12 2025 ..
drwxr-xr-x allie allie  0 B Sat Dec 20 15:15:03 2025 lombok

Any help would be very very appreciated!!

What did you expect to happen?

I expected the extension to automatically download jdtls and run it, currently the only thing working is syntax highlighting.

Environment

Zed: 0.217.2
Platform: Arch Linux 6.18.1-arch1-2
Java: OpenJDK 25.0.1 and Eclipse Temurin 21.0.9

Activity

  1. added theissue type on Dec 21, 2025
  2. added a commit that references this issue on Dec 21, 2025
    a89b5d8
  3. Tobbe commented on Feb 4, 2026

    @Tobbe

    I'm running into this same error message, but for v6.8.8

    Language server jdtls:
    
    from extension "Java" version 6.8.8: No such file or directory (os error 2)
    

    This is the first time I try to set up Java on this machine, so maybe something else is wrong

    ❯ java --version
    openjdk 25.0.2 2026-01-20
    OpenJDK Runtime Environment Homebrew (build 25.0.2)
    OpenJDK 64-Bit Server VM Homebrew (build 25.0.2, mixed mode, sharing)
    
    ❯ echo $JAVA_HOME
    /opt/homebrew/opt/openjdk/libexec/openjdk.jdk
    
    Zed: v0.221.5+stable.141.03bfbf242c57f7fdb45708d63d74182898edf2c5 (Zed) 
    OS: macOS 15.2
    Memory: 36 GiB
    Architecture: aarch64
    
  4. tartarughina commented on Feb 6, 2026

    @tartarughina
    Collaborator

    @Tobbe were you able to configure the extension?

    I see now how returning the OS's error without decorating it with the specific location where it happened is not the greatest UX wise.

    I'll push a change so that these errors are all going to be decorated with the specific location where they were emitted.

  5. Tobbe commented on Feb 7, 2026

    @Tobbe

    @tartarughina No, unfortunately did not figure out how to get past the error

  6. tartarughina commented on Feb 7, 2026

    @tartarughina
    Collaborator

    Could you share your extension config file? @Tobbe

    The places where such error could be emitted are few and mostly related to Java exe location.

  7. Tobbe commented on Feb 7, 2026

    @Tobbe

    @tartarughina of course, just tell me where to look and I'll copy/paste it for you

  8. Tobbe commented on Feb 7, 2026

    @Tobbe

    If you just mean my settings file, it looks like this

    // Zed settings
    //
    // For information on how to configure Zed, see the Zed
    // documentation: https://zed.dev/docs/configuring-zed
    //
    // To see all of Zed's default settings without changing your
    // custom settings, run the `open default settings` command
    // from the command palette or from `Zed` application menu.
    {
      "edit_predictions": {
        "provider": "zed"
      },
      "soft_wrap": "prefer_line",
      "colorize_brackets": true,
      "context_servers": {
        "cedar": {
          "enabled": false,
          "command": "node",
          "args": ["/Users/tobbe/dev/cedarjs/cedar-mcp/build/index.js"],
          "env": null,
        },
      },
      "icon_theme": "Bearded Icon Theme",
      "agent": {
        "always_allow_tool_actions": true,
        "default_profile": "write",
        "inline_assistant_model": {
          "provider": "copilot_chat",
          "model": "gemini-2.0-flash-001",
        },
        "default_model": {
          "provider": "copilot_chat",
          "model": "oswe-vscode-prime",
        },
      },
      "vim_mode": true,
      "cursor_blink": false,
      "theme": "Gruvbox Dark",
      "ui_font_size": 16,
      "ui_font_family": "Zed Plex Sans",
      "buffer_font_size": 12.0,
      "buffer_font_family": "ZedMono Nerd Font",
      "buffer_line_height": {
        "custom": 1.25,
      },
      "terminal": {
        "max_scroll_history_lines": 100000,
        "line_height": {
          "custom": 1.25,
        },
        "font_size": 12,
        "minimum_contrast": 40,
      },
      "relative_line_numbers": "disabled",
      "vim": {
        "use_system_clipboard": "never",
      },
      "wrap_guides": [80],
      "command_aliases": {
        "Q": "q",
        "W": "w",
        "Wa": "wa",
        "WA": "wa",
      },
      "languages": {
        "C": {
          "format_on_save": "on",
          "indent_guides": {
            "coloring": "disabled",
            "background_coloring": "disabled"
          },
          "tab_size": 2,
          "show_edit_predictions": false
        },
        "CSS": {
          "tab_size": 2,
        },
        "HTML": {
          "tab_size": 2,
        },
        // "TypeScript": {
        //   "language_servers": ["typescript-language-server", "!vtsls"]
        // }
      },
      "pane_split_direction_vertical": "right",
      "pane_split_direction_horizontal": "down",
      // "lsp": {
      //   "vtsls": {
      //     "settings": {
      //       // For TypeScript:
      //       "typescript": {
      //         "tsserver": { "maxTsServerMemory": 16184, "log": "verbose" }
      //       },
      //       // For JavaScript:
      //       "javascript": {
      //         "tsserver": { "maxTsServerMemory": 16184, "log": "verbose" }
      //       }
      //     }
      //   }
      // }
      "lsp": {
        "prisma-language-server": {
          "settings": {
            "prisma": {
              "pinToPrisma6": true,
            },
          },
        },
      },
    }
    
  9. tartarughina commented on Feb 7, 2026

    @tartarughina
    Collaborator

    I was referring exactly to that, please look at the README for a reference setting.

    Setting the java_home option is likely going to fix your issue

  10. Tobbe commented on Feb 7, 2026

    @Tobbe

    I have this now

      "lsp": {
        "prisma-language-server": {
          "settings": {
            "prisma": {
              "pinToPrisma6": true,
            },
          },
        },
        "jdtls": {
          "settings": {
            "java_home": "/opt/homebrew/opt/openjdk/libexec/openjdk.jdk",
          },
        },
      }

    Where "java_home" is just a copy of my JAVA_HOME environment variable.
    But I still get the same error

  11. tartarughina commented on Feb 7, 2026

    @tartarughina
    Collaborator

    I've published PR #186 that is going to help you debug what is failing. If you're not familiar with installing development versions it should be available in a couple of days at the most.

  12. Tobbe commented on Feb 7, 2026

    @Tobbe

    I've published PR #186 that is going to help you debug what is failing. If you're not familiar with installing development versions it should be available in a couple of days at the most.

    Thanks! I'll wait for 6.8.9 and then try again :)

  13. tartarughina commented on Feb 7, 2026

    @tartarughina
    Collaborator

    @Tobbe new version available!

  14. Tobbe commented on Feb 7, 2026

    @Tobbe

    Sweet! So I just tried it, and this new error message is much more informative!

    Language server jdtls:
    
    from extension "Java" version 6.8.9: Failed to build JDTLS launch arguments: 
    Failed to determine Java version: 
    Failed to execute '/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/bin/java -version': 
    No such file or directory (os error 2)
    

    Updating "java_home" in my config to be /opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home made the LSP load!

    But now I get a bunch of unexpected errors reported by the LSP instead 😅 Here's one of them

    Image
  15. tartarughina commented on Feb 7, 2026

    @tartarughina
    Collaborator

    Check out #146, similar issue as that one, you need to provide JDTLS some init options

  16. Tobbe commented on Feb 10, 2026

    @Tobbe

    I opened up the project again, and added another package. And that one works great.
    So I tried renaming the existing package. And all of a sudden that one also started working.
    So I tried renaming it back to the original, and now it's broken again.
    Literally every other name, except for the original, works.
    What is it that it doesn't like with the package name in my screenshot I posted earlier?

  17. tartarughina commented on Feb 10, 2026

    @tartarughina
    Collaborator

    @Tobbe When you have a java file open, run the task for cleaning the cache. The issue you're facing might be caused by that.

  18. Tobbe commented on Feb 10, 2026

    @Tobbe

    Unfortunately did not work. It made things worse. Now the new package files I added are also broken 😆
    But thanks for letting me know about the clear cache task, I'm sure it'll come in handy in the future!

    So maybe now I need to provide those JDTLS init options. I looked at #146 but the list there is so long! I have no idea where to even start and/or what I'd need to adapt to my setup

  19. tartarughina commented on Feb 10, 2026

    @tartarughina
    Collaborator

    @Tobbe If you don't plan to use the settings from #146 consider to use those from the README

    {
      "lsp": {
        "jdtls": {
          "settings": {
            "initialization_options": {
              "bundles": [],
              "settings": {
                "java": {
                  "errors": {
                    "incompleteClasspath": {
                      "severity": "warning"
                    }
                  },
                  "configuration": {
                    "updateBuildConfiguration": "interactive",
                    "maven": {
                      "userSettings": null
                    }
                  },
                  "import": {
                    "gradle": {
                      "enabled": true
                    },
                    "maven": {
                      "enabled": true
                    },
                    "exclusions": [
                      "**/node_modules/**",
                      "**/.metadata/**",
                      "**/archetype-resources/**",
                      "**/META-INF/maven/**",
                      "/**/test/**"
                    ]
                  },
                  "referencesCodeLens": {
                    "enabled": false
                  },
                  "signatureHelp": {
                    "enabled": false
                  },
                  "implementationCodeLens": "all",
                  "format": {
                    "enabled": true
                  },
                  "saveActions": {
                    "organizeImports": false
                  },
                  "contentProvider": {
                    "preferred": null
                  },
                  "autobuild": {
                    "enabled": false
                  },
                  "completion": {
                    "favoriteStaticMembers": [
                      "org.junit.Assert.*",
                      "org.junit.Assume.*",
                      "org.junit.jupiter.api.Assertions.*",
                      "org.junit.jupiter.api.Assumptions.*",
                      "org.junit.jupiter.api.DynamicContainer.*",
                      "org.junit.jupiter.api.DynamicTest.*"
                    ],
                    "importOrder": ["java", "javax", "com", "org"]
                  }
                }
              }
            }
          }
        }
      }
    }
    

    If things are broken restart the language server, it might pick up either the change in the cache or in the settings in that way

  20. Tobbe commented on Feb 11, 2026

    @Tobbe

    I copy/pasted those settings, and added my java_home setting that I added before.
    Then I restarted the language server
    Didn't help
    So I cleared the cache, and restarted the language server again

    Still getting the same error unfortunately

  21. tartarughina commented on Feb 12, 2026

    @tartarughina
    Collaborator

    @Tobbe check this out #39 (comment)

  22. Tobbe commented on Feb 12, 2026

    @Tobbe

    Yes!!! Finally! 😁 It works now. I'm so happy 🎉

    Thank you so much for helping me fix this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    language-serverRelated to the language server.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions