Skip to content

Windows: install error: failed to run jdtls #81

Closed

Description

@wilkice

Relevance Confirmation

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

What happened?

when I installed extension in windows, there is error message in left bottom

Image

when click it, error log is

Language server jdtls:

initializing server jdtls, id 8: Server reset the connection
-- stderr --
node:internal/child_process:421
    throw new ErrnoException(err, 'spawn');
          ^

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:760:9)
    at file:///F:/code/eureka-client-1/[eval1]:31:13
    at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:220:26)
    at async ModuleLoader.eval (node:internal/modules/esm/loader:216:20)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:109:5) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'
}

Node.js v22.5.1

What did you expect to happen?

extension works fine

Environment

Zed: v0.202.6 (Zed)
OS: Windows 10.0.26100
Memory: 39.8 GiB
Architecture: x86_64
GPU: Intel(R) Iris(R) Xe Graphics || Intel Corporation || 31.0.101.5186

Java: 1.8.0_462

Activity

  1. added theissue type on Sep 4, 2025
  2. tartarughina commented on Sep 4, 2025

    @tartarughina
    Collaborator

    The issue might be related with the Java version that zed is using to launch jdtls.

    Have you tried using version 21 or 24?

  3. wilkice commented on Sep 4, 2025

    @wilkice
    Author

    @tartarughina tried jdk 24, but still have error

    Image
  4. tartarughina commented on Sep 4, 2025

    @tartarughina
    Collaborator

    What do you have set in Zed config? This is mine for example

    {
    	"lsp": {
    		"jdtls": {
    			"initialization_options": {
    				"settings": {
    					"java": {
    						"home": "~/.local/share/mise/installs/java/24"
    					}
    				}
    			}
    		}
    	}
    }
  5. wilkice commented on Sep 5, 2025

    @wilkice
    Author

    my config is

      "lsp": {
        "jdtls": {
          "initialization_options": {
            "settings": {
              "java": {
                "home": "E:\\installer\\jdk-24_windows-x64_bin\\jdk-24.0.2"
              }
            }
          }
        }
      }
    

    BTW, I searched the error Error: spawn EINVAL and find some related issue, not sure if the spawn function need shell=True

    const lsp = spawn(bin, args);

    nodejs/node#52681

  6. Komposten commented on Sep 13, 2025

    @Komposten
    Contributor

    Can confirm, using spawn(bin, args, { shell: true }) fixes the issue.

  7. added a commit that references this issue on Oct 3, 2025
    d6428c7
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