From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.help Subject: Re: java anyone? Date: Mon, 19 Jul 2021 07:17:59 +0900 Message-ID: <3D208F9C-6A01-4200-8E8B-3FA8B9015C9B@traduction-libre.org> References: <1244C95E-DD3D-4022-AAF8-54BEBA49C49C@traduction-libre.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28145"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Pankaj Jangid Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 19 00:18:56 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5F7e-00076D-Tt for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 19 Jul 2021 00:18:54 +0200 Original-Received: from localhost ([::1]:44316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5F7d-0003kY-Ux for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Jul 2021 18:18:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5F70-0003kD-KN for help-gnu-emacs@gnu.org; Sun, 18 Jul 2021 18:18:14 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:30681) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5F6x-0001pY-MF for help-gnu-emacs@gnu.org; Sun, 18 Jul 2021 18:18:14 -0400 Original-Received: (Authenticated sender: lists@traduction-libre.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 7FA84240004; Sun, 18 Jul 2021 22:18:04 +0000 (UTC) In-Reply-To: X-Mailer: Apple Mail (2.3654.100.0.2.22) Received-SPF: pass client-ip=217.70.183.193; envelope-from=lists@traduction-libre.org; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131835 Archived-At: Thank you Pankaj. I'll give that a try. Jean-Christophe=20 > On Jul 18, 2021, at 20:26, Pankaj Jangid = wrote: >=20 > Jean-Christophe Helary writes: >=20 >> 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. >=20 > 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. >=20 > 1. Tell Emacs the value of JAVA_HOME. =E2=80=98(setenv "JAVA_HOME" = ...)=E2=80=99 >=20 > 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 (=E2=80=98= mvn > clean; mvn package=E2=80=99), you must add the language server JAR = to the > CLASSPATH. I use the following snippet: >=20 > --8<---------------cut here---------------start------------->8--- > (defun add-to-classpath (item) > "Add ITEM to CLASSPATH." >=20 > (let ((class-path (getenv "CLASSPATH"))) >=20 > (defvar class-path-list (if class-path > (split-string class-path ":"))) > (cl-pushnew item class-path-list) > (setenv "CLASSPATH" > (mapconcat 'identity class-path-list ":")))) >=20 > (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--- >=20 > 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.=20 >=20 > It also works with company; but that is not required. >=20 >=20 --=20 Jean-Christophe Helary @brandelune https://mac4translators.blogspot.com https://sr.ht/~brandelune/omegat-as-a-book/