Tuesday, September 23, 2008

Installing JDE for Emacs

I'm working on a project that requires me to keep track of many Java classes more or less at once. Until now, I haven't felt that Emacs' default Java mode lacks anything I need for coding, but for this project, I'd like something that can help me keep track of everything. I looked briefly at the various IDEs out there, but the truth is that I like Emacs and don't want to start using another tool. Instead I decided to try the Java Development Environment for Emacs.

The first step is getting it installed. Here are the steps I followed which are basically the same as those outlined on the JDE page.
  1. Install the Collection of Emacs Development Environment Tools (CEDET):
    • I downloaded the cedet-1.0pre4.tar.gz file from the CEDET page. As of this writing it appears that they are working on a 1.0 version, but only pre-releases are available.
    • I uncompressed the file and followed the instructions in the INSTALL file. For me, I just had to type make, and copy the load hooks (specified in the INSTALL file) into my .emacs file. Note that the load hooks try to load the file ~/cedet-VERSION/common/cedet.el. You'll need to change VERSION to the actual version you are using and change the path to point where you actually have the cedet directory. I put mine in my .emacs.d directory. To test this, load your .emacs file. Hopefully, you won't get any errors.
  2. Install the Emacs Lisp library (elib) package. I did this by downloading and following the instructions on the requirements section of the JDE page.
  3. You'll need Java (of course) which you can get at the Java site.
  4. Download the JDE which you can do at the JDE page and follow the install directions on the install page.
    • Uncompress the file in the directory you want the JDE files to reside. I chose my .emacs.d directory.
    • Add some lisp forms which are on the install page to your .emacs. Note that you'll have to change the paths in the lisp forms according to your setup.
    • Follow the remaining instructions. There's an example .emacs file that you can compare to which is helpful. You'll also need to set up a variety of variables that tell the JDE about your JDK, etc. It takes a bit of tweaking.
I have it installed now. I'll post any problems or quirks I find along with solutions if I find them in a separate post.

No comments: