Here’s a great tool named Eclim which brings Eclipse to vim and there’s an emacs port as well. I’ve tested for both vim and emacs and I think vim version is better than the emacs version. Emacs version needs work. I’m jealous.
Follow these instructions to install eclim.
Download emacs plugin from here.
Move downloaded emacs plugin to your .emacs.d/
Write the following to your .emacs;
Whenever you need to do Java development, first open a console and run the eclimd and then open emacs.