6

I imagine most developers, like myself, starting out with JDEE are beginning with source code that is already written as opposed to a new empty project. What I'm asking for is a simple explanation of how to get JDEE set up for an existing Java project.

The user's guide on the JDEE website explains this to some degree, but is organized more as a highly detailed tutorial and isn't always clear on which settings are required and which are optional. Also, the user's guide uses custom variables as opposed to settings that can easily be pasted into and modified in a .emacs file. I'm looking for something that can easily be copied and pasted into a .emacs file (and any other files, such as project files) and modified to suit the file paths a developer already has.

The setup should allow the use of all of the features available in JDEE that one typically expects in an IDE such as Eclipse. Please assume that the developer reading your answer has JDEE installed in Emacs, but has not gone any further than that.

I've been struggling to get this set up at home and look forward to the answers I receive so I can learn more about Java and Emacs.

  • 3
    To be fair, I'm surprised to see JDEE seems to get some work lately. I thought it was abandoned few years ago. But, here are few things from my memory of its previous incarnation: 1. The project is really big, so don't hope to understand it all at once. 2. It comes with Ant and Maven modes, if you have existing Java projects, chances are it has an Ant / Maven build scripts (there's also a Gradle mode iirc, but it's not part of JDEE). 3. Emacs configuration is just the variables that you set. It's easier if you ask specific questions--more chances of a proper answer. – wvxvw Feb 21 '15 at 19:04
  • 1
    @wvxvw just curious of JDEE is extinct what do people use for Java based projects? – user1172468 Jun 22 '15 at 5:26
  • 2
    @user1172468 In the last couple of years I didn't work on any large Java projects, so I wouldn't know. Alex Ott is the only person I've heard of to work with Java in Emacs (I think he has his Emacs setup here: github.com/alexott?tab=repositories ). But I'm afraid that the answer will be along the lines of: there are no advanced language support at the moment, no contextual word completion, no refactoring or "jump to source" functionality available. – wvxvw Jun 22 '15 at 9:57
  • I suggest simpler solution. See blog.binchen.org/posts/emacs-as-c-ide-easy-way.html I did use it in commercial java project. It's not perfect but practical. – chen bin Jun 1 '17 at 2:06
2

I recommend you having look at emacs-eclim. It uses Eclipse as a backend and provides many feature you'd want, like context aware auto-completion, correction-suggestions, documentation lookup and source navigation.

To give you an overview: So to set it up with an existing project, do $ mvn eclipse:eclipse inside your project, then open up Eclipse and do a "import existing java project". Then quit Eclipse, start eclimd in a shell (it'll use the Eclipse workspace you just created) and go back to your happy place (aka Emacs).

I've written up how I set it up, as well as several screenshots here: http://skybert.net/emacs/java/.

Good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.