Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

jdtls-server will not start.

Open
#426 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
emacs-lisp, java

Research direction

Start with the lsp-java--ls-command value and the Java paths in the issue, then compare the manually executed command with the Messages and stderr buffers. The issue is resolved when lsp-java starts jdtls successfully and no longer reports exit code 13.

Written by the indexing model from the issue text.

Description

This problem seems closely related to #293.

When trying to start the lsp-java server, I receive the message

Server jdtls:27072/starting exited with status exit(check corresponding stderr buffer for detail). Do you want to restart it? (y or n)

When looking in the Messages buffer, I read

using config for config_linux
LSP :: Connected to [jdtls:34071/starting].
When done with a buffer, type C-x #
LSP :: jdtls has exited (exited abnormally with code 13)
Server jdtls:34071/starting exited with status exit(check corresponding stderr buffer for details). Do you want to restart it? (y or n) y

The stderr buffer reads

Process jdtls stderr finished

M-: lsp-java--ls-command results in

("/usr/lib/jvm/java-19-openjdk/bin/java" "-Declipse.application=org.eclipse.jdt.ls.core.id1" "-Dosgi.bundles.defaultStartLevel=4" "-Declipse.product=org.eclipse.jdt.ls.core.product" "-Dlog.protocol=true" "-Dlog.level=ALL" "-XX:+UseParallelGC" "-XX:GCTimeRatio=4" "-XX:AdaptiveSizePolicyWeight=90" "-Dsun.zip.disableMemoryMapping=true" "-Xmx1G" "-Xms100m" "-jar" "/home/user-name/.emacs.d/.cache/lsp/eclipse.jdt.ls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar" "-configuration" "/home/user-name/.emacs.d/.cache/lsp/eclipse.jdt.ls/config_linux" "-data" "/home/user-name/.emacs.d/workspace/" "--add-modules=ALL-SYSTEM" "--add-opens java.base/java.util=ALL-UNNAMED" "--add-opens java.base/java.lang=ALL-UNNAMED")

Manually executing the code gives

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Content-Length: 122

{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"26.03.2023, 13:55:15 Main thread is waiting"}}

I have multiple versions of Java installed, but the current version (found out by which java) is java-19-openjdk. I am using the code below to setup my Emacs for lsp-java.

  (use-package lsp-java
  :ensure t
  :config
  (add-hook 'java-mode-hook 'lsp)
  (setq lsp-java-completion-max-results 10)
  (setenv "JAVA_HOME"  "/usr/lib/jvm/java-19-openjdk/")
  (setq lsp-java-inhibit-message nil)
  (setq lsp-java-save-actions-organize-imports t)
  (setq lsp-java-java-path "/usr/lib/jvm/java-19-openjdk/bin/java")
  (setq lsp-java-configuration-runtimes '[(:name "JavaSE-19"
                                                 :path "/usr/lib/jvm/java-19-openjdk/"
                                                 :default t)]))

(use-package dap-mode
  :ensure t
  :after lsp-mode
  :config (dap-auto-configure-mode))

(use-package dap-java :ensure nil)

As you can see, I am already trying to make every path explicit. What I have also tried is …

  1. deleting the path of lsp-java-workspace-dir.
  2. Reinstalling the jdtls server.

What could be the problem?

Dominant language
Emacs Lisp
Stars
696
Forks
97
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from emacs-lsp/lsp-java

All issues in emacs-lsp/lsp-java

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.