Emacs as Java ICE

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Emacs as Java ICE

Thierry Leurent
Hello,

I'm starting with java development so I need  configure emacs.
I must use Maven, Java and JavaFX.

I see there are lot of solutions and it's a little  bit confusing
I use Java in an academic environment so I  need have indentation, auto completion and snippets for Java and maven.

Do you have a good solution ?



Regards,


Thierry

Reply | Threaded
Open this post in threaded view
|

Re: Emacs as Java ICE

Carlos Konstanski-2
The first place to look is Java Development Environment for Emacs
(JDEE). It is available in list-packages.

Am Dienstag, den 26.11.2019, 18:40 +0100 schrieb
[hidden email]:

> Hello,
>
> I'm starting with java development so I need  configure emacs.
> I must use Maven, Java and JavaFX.
>
> I see there are lot of solutions and it's a little  bit confusing
> I use Java in an academic environment so I  need have indentation,
> auto completion and snippets for Java and maven.
>
> Do you have a good solution ?
>
>
>
> Regards,
>
>
> Thierry
>


Reply | Threaded
Open this post in threaded view
|

Re: Emacs as Java ICE

Dan Čermák
In reply to this post by Thierry Leurent
Hi Thierry,

<[hidden email]> writes:

> Hello,
>
> I'm starting with java development so I need  configure emacs.
> I must use Maven, Java and JavaFX.
>
> I see there are lot of solutions and it's a little  bit confusing
> I use Java in an academic environment so I  need have indentation, auto completion and snippets for Java and maven.
>
> Do you have a good solution ?
>
I would suggest to take a look at lsp-mode
(https://github.com/emacs-lsp/lsp-mode) and lsp-java
(https://github.com/emacs-lsp/lsp-java). Unfortunately, I am not a Java
coder, so I have never used lsp-java, but I am using lsp-mode for
Python, C++, C and Ruby, where it works very well.


Hope that helps,

Dan

signature.asc (847 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Emacs as Java ICE

Pankaj Jangid-2
Dan Čermák <[hidden email]> writes:
>> I must use Maven, Java and JavaFX.
>>
>> I see there are lot of solutions and it's a little  bit confusing I
>> use Java in an academic environment so I  need have indentation, auto
>> completion and snippets for Java and maven.

> I would suggest to take a look at lsp-mode
> (https://github.com/emacs-lsp/lsp-mode) and lsp-java
> (https://github.com/emacs-lsp/lsp-java).

This works very well for me. The only thing is that you need to
configure LSP server for Java yourself. There are many options for that
but the one that I use is *eclipse.jdt.ls*
([hidden email]:eclipse/eclipse.jdt.ls.git).

Once you build it then set this

(setq lsp-java-server-install-dir (expand-file-name
"<path-to>/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/"))

Regards,
--
Pankaj Jangid

Reply | Threaded
Open this post in threaded view
|

Re: Emacs as Java ICE

Filipp Gunbin
In reply to this post by Thierry Leurent
I use minimal setup of standard java-mode (for indentation, imenu
support, etc) and javaimp package (available in GNU ELPA, see
list-packages) which provides completion when adding imports (taking
dependency info from Maven or Gradle).

For more complete support I'd look at lsp or eglot, though I don't use
them myself and thus cannot tell the details.

JDEE I think is rather outdated and probably won't work :-(

Filipp

Reply | Threaded
Open this post in threaded view
|

Re: Emacs as Java ICE

Carlos Konstanski-2
JDEE suffered a period of stagnation a few years ago, but it's back now
and it works just fine. It may even support maven now, though I haven't
tried it. I work on a project that uses gradle, so I just wrote an ant
wrapper.

Am Mittwoch, den 27.11.2019, 16:28 +0300 schrieb Filipp Gunbin:

> I use minimal setup of standard java-mode (for indentation, imenu
> support, etc) and javaimp package (available in GNU ELPA, see
> list-packages) which provides completion when adding imports (taking
> dependency info from Maven or Gradle).
>
> For more complete support I'd look at lsp or eglot, though I don't
> use
> them myself and thus cannot tell the details.
>
> JDEE I think is rather outdated and probably won't work :-(
>
> Filipp
>


Reply | Threaded
Open this post in threaded view
|

Re: Emacs as Java ICE

Bob Proulx
In reply to this post by Thierry Leurent
[hidden email] wrote:
> I'm starting with java development so I need configure emacs.

I am not a Java programmer so do not use any of this but the recent
EmacsConf lightning talk by Torstein Krause Johansen, "How Emacs
became my awesome Java editing environment" is available.

List of videos:

  https://emacsconf.org/2019/videos

Search for "Java" to find:

  "How Emacs became my awesome Java editing environment"

Bob

P.S. The direct links were not guarenteed to be persistent and
therefore it was requested to link to the page above and then one
could find the current location of the direct links.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs as Java ICE

Carlos Konstanski-2
In reply to this post by Thierry Leurent
JDEE and lsp-java seem to be the two real IDE packages for java. They are very
different from one another in their approaches. I'm far more familiar with JDEE
(because it's older and it existed back when I first needed a java IDE for emacs
in 2004) but I'm eager to learn more about lsp-java. One thing that I have not
been able to figure out with JDEE, and hope that lsp-java handles better, is
microservice architecture. These days it is increasingly common for an
application to be comprised of multiple components which are each their own sub-
project and which may have cross-dependencies with the other components. The
definition of a symbol might be in a different component, and compiling a
component might require first compiling another component. A modern java IDE
must be able to handle this architecture.

Am Dienstag, den 26.11.2019, 18:40 +0100 schrieb [hidden email]:

> Hello,
>
> I'm starting with java development so I need  configure emacs.
> I must use Maven, Java and JavaFX.
>
> I see there are lot of solutions and it's a little  bit confusing
> I use Java in an academic environment so I  need have indentation, auto
> completion and snippets for Java and maven.
>
> Do you have a good solution ?
>
>
>
> Regards,
>
>
> Thierry
>