Skip to content

lombok_jar absolute Windows path is joined to extension workdir, breaking JDTLS startup #300

Description

@cloud0106

Environment

  • OS: Windows
  • Extension version: 6.8.25

Description

When lsp.jdtls.settings.lombok_jar is set to an absolute Windows path (as documented in the README), JDTLS fails to start.

Steps to reproduce

  1. Set in settings.json:
"lsp": {
  "jdtls": {
    "settings": {
      "lombok_jar": "D:\path\to\lombok-1.18.36.jar"
    }
  }
}
  1. Open any Java file.

Actual behavior

The language server resets the connection. The log shows:

initializing server jdtls, id 1: Server reset the connection
-- stderr --
Error opening zip file or JAR manifest missing : <USERPROFILE>/AppData/Local/Zed/extensions/work/java/D:/path/to/lombok-1.18.36.jar

The configured absolute path is concatenated onto the extension workdir instead of being used as-is.

Expected behavior

The configured absolute path is passed to JDTLS as the -javaagent argument without modification.

Root cause

In src/jdtls_server.rs, command() builds the agent argument with current_dir.join(lombok_jar_path). The extension runs as WASM, which uses POSIX path semantics — a Windows drive-qualified path like D:\... is not treated as absolute there, so join() appends it to the workdir. This does not happen on macOS/Linux because POSIX absolute paths start with /.

Also affected

  • java_debug_jarsrc/debugger.rs uses the same current_dir.join(...) pattern in inject_plugin_into_options().

Workaround

Copy the jar into the extension workdir and reference it with a relative path:

extensions/work/java/lombok/lombok-1.18.36.jar
"lombok_jar": "lombok/lombok-1.18.36.jar"

Suggested fix

Only join the configured path with the workdir when it is relative; detect Windows drive-letter paths (e.g. a leading X:\ or X:/ prefix) and use them as-is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions