unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean-Christophe Helary <lists@traduction-libre.org>
To: Pankaj Jangid <pankaj@codeisgreat.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: java anyone?
Date: Mon, 19 Jul 2021 07:17:59 +0900	[thread overview]
Message-ID: <3D208F9C-6A01-4200-8E8B-3FA8B9015C9B@traduction-libre.org> (raw)
In-Reply-To: <m2lf637thm.fsf@codeisgreat.org>

Thank you Pankaj. I'll give that a try.

Jean-Christophe 

> On Jul 18, 2021, at 20:26, Pankaj Jangid <pankaj@codeisgreat.org> wrote:
> 
> Jean-Christophe Helary <lists@traduction-libre.org> writes:
> 
>> I need something where I can just lookup functions in a code base with
>> a local javadoc tree, including online Oracle documentation, etc. Not
>> a full-fledged IDE with completion.
> 
> I use a very lightweight language server facilitator, named Eglot. There
> are a couple of settings that are required for this to work. This is the
> minimal set that I came-up with after discussing in and following the
> Eglot tracker.
> 
> 1. Tell Emacs the value of JAVA_HOME. ‘(setenv "JAVA_HOME" ...)’
> 
> 2. By default, Eglot uses, Eclipse JDT Language server so you need to
>   install it somewhere. I simply pulled the git repository at
>   ~/.emacs.d/eclipse.jdt.ls. After building the Eclipse JDT LS (‘mvn
>   clean; mvn package’), you must add the language server JAR to the
>   CLASSPATH. I use the following snippet:
> 
> --8<---------------cut here---------------start------------->8---
>   (defun add-to-classpath (item)
>     "Add ITEM to CLASSPATH."
> 
>     (let ((class-path (getenv "CLASSPATH")))
> 
>       (defvar class-path-list (if class-path
>                                   (split-string class-path ":")))
>       (cl-pushnew item class-path-list)
>       (setenv "CLASSPATH"
>               (mapconcat 'identity class-path-list ":"))))
> 
>   (add-to-classpath
>    (substring
>     (shell-command-to-string
>      (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)))
>     0 -1))
> --8<---------------cut here---------------end--------------->8---
> 
> Eglot works with project.el, xref.el, eldoc.el etc. So many usual things
> will work out of the box. Like online help when the point is inside a
> function name. 
> 
> It also works with company; but that is not required.
> 
> 

-- 
Jean-Christophe Helary @brandelune
https://mac4translators.blogspot.com
https://sr.ht/~brandelune/omegat-as-a-book/




      reply	other threads:[~2021-07-18 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17 22:34 java anyone? Jean-Christophe Helary
2021-07-17 22:42 ` Dmitry Gutov
2021-07-18  2:32   ` Jean-Christophe Helary
2021-07-18 11:26 ` Pankaj Jangid
2021-07-18 22:17   ` Jean-Christophe Helary [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D208F9C-6A01-4200-8E8B-3FA8B9015C9B@traduction-libre.org \
    --to=lists@traduction-libre.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=pankaj@codeisgreat.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).