emacs-lsp / lsp-java

lsp-mode :heart: java
https://emacs-lsp.github.io/lsp-java
GNU General Public License v3.0
648 stars 90 forks source link

Have to start emacs with sudo, otherwise jdtls won't work #452

Open Crayon277 opened 1 year ago

Crayon277 commented 1 year ago

Describe the bug jdtls exit immediately when I launch emacs normally (normally means click the app icon, type emacs on iterm) and report Server jdtls:67683/starting exited (check corresponding stderr buffer for details). Do you want to restart it? (y or n)

UNLESS , I use sudo emacs to launch the emacs. Is that normal? Because I don't see any requirement of root authority on the chain.

Environment macOS: Ventura 13.5.1 emacs: emacs-plus@29.1 (installed by brew) lsp-java: 20230827.428 jdtls : jdt-language-server-1.26.0-202307271613 java : 17 (JAVA_HOME is setted by jenv)

To Reproduce

  1. Download jdtls-1.26 from http://download.eclipse.org/jdtls/milestones/
  2. add jdtls' bin dir to PATH. By the way , the directory which hold the jdtls can access by normal authority , no need sudo. export PATH=/Users/mmmmmcclxxvii/.emacs.d/lsp-server/jdt-language-server-1.26.0-202307271613/bin:$PATH image
  3. Install lap-java via melpa
  4. (setq lsp-java-server-install-dir "~/.emacs.d/lsp-server/jdt-language-server-1.26.0-202307271613")
  5. configure follow by Quick start
  6. launch emacs --debug-init
  7. C-x C-f open ~/Develop/temp/Application.java

Expected behavior show: LSP:: jdtls connected to xxxx

Screenshots

image

Above screenshot is launching emacs normally


image

Above screenshot is launching emacs via sudo emacs

Crayon277 commented 1 year ago

info from lsp-log


Command "semgrep lsp" is not present on the path.
Command "semgrep lsp" is not present on the path.
Found the following clients for /Users/mmmmmcclxxvii/Develop/temp/Application.java: (server-id jdtls, priority 0)
The following clients were selected based on priority: (server-id jdtls, priority 0)
Command "semgrep lsp" is not present on the path.
Command "semgrep lsp" is not present on the path.
Found the following clients for /Users/mmmmmcclxxvii/Develop/temp/Application.java: (server-id jdtls, priority 0)
The following clients were selected based on priority: (server-id jdtls, priority 0)
``
ashton commented 10 months ago

Same error here, also with jdtls, using doom emacs

ashton commented 10 months ago

trying to install semgrep manually results in another error image