jdtls-server will not start.
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
- Domain
- developer-experience, tooling
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 …
- deleting the path of lsp-java-workspace-dir.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from emacs-lsp/lsp-java
-
dap-java discards module paths from resolveClasspath causing JPMS-modular projects fail to launchOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in emacs-lsp/lsp-java
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
detectors enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
SM260845/readme-gen#1 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ehmpathy/rhachet-roles-bhuild#407 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
codymikol/multiverse.nvim#330 ·
Maintainers usually reply within 8 days
-
bug cli dx
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
videojs/v10#3001 · 1 comment ·
Maintainers usually reply within 1 day