help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java programming and emacs


From: Steve Revilak
Subject: Re: Java programming and emacs
Date: Wed, 6 Jan 2010 21:59:39 -0500
User-agent: Mutt/1.5.19 (2009-01-05)

From: Xavier Maillard <address@hidden>

I have started for a few weeks now coding for the Android
platform. That's pretty new to me and thus I am not really
informed of what I can use in Emacs to be more productive.

I am looking for a good setup that could integrate java
programming, checkstyle plugin support and SVN (code I am working
on is hosted on code.google.com).

I do a fair amount of java programming with emacs, so I can share a
few things that have been helpful for me.

 - If you're using ant to build your java code
(setq compile-command "ant -find build.xml ") is helpful

 - If you're using ant, set the environment variable
   "ANT_ARGS=-emacs".  This causes ant to emit output in a format that
   compliation mode can understand

 - If checkstyle has an ant task, then you can probably just run
   checkstyle with ant (i.e., put a checkstyle target in your build.xml).

 - For code navigation, gnu global works pretty well with java.
   Global seems to understand java's language structure a little
   better than etags does.

     http://www.gnu.org/software/global/

   Global comes with a lisp library for emacs integration.  I use it
   like this:

   (if (file-exists-p "~/.elisp/gtags.el")
       (progn
         (autoload 'gtags-mode "gtags" "" t)
         (setq java-mode-hook '(lambda () (gtags-mode 1)))
         )
     )

   Among other things, gtags-mode rebinds M-. to gtags-find-tags.
   Working in gtags-mode is similar to using regular TAGS tables.

   CEDET also looks promising, but I haven't had time to experiment
   with it.

 - vc should work fine with SVN.  At least that's been my experience.

Steve

Attachment: pgp5Ugn0F8xC0.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]