help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Editing Java (with LSP)


From: Alessandro Bertulli
Subject: Re: Editing Java (with LSP)
Date: Thu, 16 Jun 2022 15:34:04 +0200
User-agent: mu4e 1.6.11; emacs 28.1

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> I use eglot+eclipse.jdt.ls. There is a bit of struggle in setting this
> up.

For me, last time I tried eglot, the problem was making it work with
dap-mode (which in turn iirc it's strictly coupled with lsp-mode). I
really need a debugger when developing and I don't feel quite at home
with GUD/RealGUD.

> My setup is like this (assuming you have cloned eclipse.jdt.ls
> repository inside ~/.emacs.d and built using ‘./mvnw clean package’),

Actually I simply set (setq lsp-java-jdt-download-url
"https://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz";)
and then I let lsp-mode download and build it. That's why I changed your
code

>      (format
>       "find %s -name 'org.eclipse.equinox.launcher_*jar'"
>       (expand-file-name
>        "eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins"
>        user-emacs-directory))

to
(format
  "find %s -name 'org.eclipse.equinox.launcher_*jar'"
  (expand-file-name
    ".cache/lsp/eclipse.jdt.ls/plugins"
    user-emacs-directory))

However, both with your code and with mine, now when I try to open a
java file I get this error:
Error in post-command-hook (#[0 
"\303\304\301\242\305#\210\300\306.!\205.r\211q\210
?\205.\307\310\311 \")\207" [#<buffer CLIApp.java> (#0)
eglot--managed-mode remove-hook post-command-hook nil buffer-live-p
apply eglot--connect eglot--guess-contact] 4]): (file-missing "Searching
for program" "No such file or directory" "jdtls")

> Also I use ‘exec-path-from-shell’ package to setup PATHs in GUI Emacs.
Maybe this is part of the reason?

Alessandro




reply via email to

[Prev in Thread] Current Thread [Next in Thread]