views:

164

answers:

3

Emacs and Java change propagation

Hi,

I'm mostly used to code in IDE like Eclipse but I wanted to try emacs. Because I keep hearing about how much better it is than big IDE like Eclipse and Visual Studio. So I was looking at what emacs provides for Java (with the JDEE extension) but it doesn't seem as complete as Eclipse.

One of the most important thing I look for in a Java editor is change propagation and error notification. For example if I rename a class, I want to be able to have all the declarations of this class renamed automatically. And if I delete a method, I want to be able to see all the place where this creates errors.

I didn't find those things in emacs, and this is a showstopper for me, I can't see how I could work on big projects without those features.

So my question is : those features don't exist or is it just me that haven't looked at the right place?

A: 

I don't know much about Emacs (so you may regard the following as off-topic), but I work with both Eclipse and VIM.

I use Eclipse for big Java projects, and I can't live without the large-scale features (cross-project renaming/refactoring etc.). I use VIM for small scale stuff (e.g. knocking up code for StackOverflow examples in multiple languages).

Eclipse and VIM have very different capabilities and consequently I use each bearing this in mind. I don't expect VIM to do the heavy lifting, but on the other hand I don't expect Eclipse to start in a keystroke and to be able to write a new (small) project in a few seconds (in whatever language I require - not restricted to Java). Perhaps you should look at the Emacs/Eclipse pair in a similar light ?

Brian Agnew
+1  A: 

Emacs can be better that Eclipse, but the question is "for what"? Emacs (and VIM) are generally smaller, faster and optimized for text editing and navigation*. In recent versions Eclipse are quite capable for editing and navigating java code but with different "style".

If you are willing to learn Emacs then learn it. You will get experiences on your own and it is very important for a developer (you are the only one can decide what is work for you). But learning Emacs does not mean to "throw out" Eclipse, they can co-exist quite well if you use ant or maven-based project building and a source control system. You can for example do all editing in Emacs while for debugging and refactoring use Eclipse.

There are some interesting thought in this thread about Emacs and java development. Also there is an interesting read and conclusions about Emacs and Eclipse from someone who tried both environment.

If you are not an expert Eclipse user yet you should look at the powerful editing and navigating features of Eclipse before starting Emacs:

Back to the question: there is an Emacs extension called Xrefactory for Java but it does not support Java 1.5 features so it is useful only if you use Java 1.4 or older.

(*) of course they are much more, I know :)

Csaba_H
OK I guess I have my answer : emacs doesn't provide the tooling for refactoring that Eclipse brings. Emacs is more a text editor.
Alain Michel
+1  A: 

Emacs is an incredible editor, with good support for developing in C. For developing in Java there is much better support in one of the Java IDE's which has deep knowledge about the programs being edited. You probably want something like Eclipse, JDeveloper or Netbeans.

In my opinion you will not be satisified with developing Java with Emacs, and you should use another tool.

Thorbjørn Ravn Andersen