From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Revilak Newsgroups: gmane.emacs.help Subject: Re: Java programming and emacs Date: Fri, 8 Jan 2010 19:54:12 -0500 Message-ID: <20100109005412.GA406@srevilak.net> References: <20100107010315.A4F2A10AFB0@mxperim6.sea5.speakeasy.net> <20100107025939.GQ387@srevilak.net> <201001082301.o08N1e2V019906@fed.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" X-Trace: ger.gmane.org 1262998515 15470 80.91.229.12 (9 Jan 2010 00:55:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2010 00:55:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xavier Maillard Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 09 01:55:08 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NTPbf-0005lS-EO for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jan 2010 01:55:07 +0100 Original-Received: from localhost ([127.0.0.1]:59516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTPbf-0003gd-T8 for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jan 2010 19:55:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTPb4-0003bF-Qy for help-gnu-emacs@gnu.org; Fri, 08 Jan 2010 19:54:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTPb0-0003XZ-18 for help-gnu-emacs@gnu.org; Fri, 08 Jan 2010 19:54:30 -0500 Original-Received: from [199.232.76.173] (port=57503 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTPaz-0003XQ-Rx for help-gnu-emacs@gnu.org; Fri, 08 Jan 2010 19:54:25 -0500 Original-Received: from mail6.sea5.speakeasy.net ([69.17.117.8]:56653) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NTPaz-0005qc-2W for help-gnu-emacs@gnu.org; Fri, 08 Jan 2010 19:54:25 -0500 Original-Received: (qmail 19268 invoked from network); 9 Jan 2010 00:54:20 -0000 Original-Received: from pool-96-233-67-44.bstnma.fios.verizon.net (HELO srevilak.net) (srevilak@[96.233.67.44]) (envelope-sender ) by mail6.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 9 Jan 2010 00:54:19 -0000 Content-Disposition: inline In-Reply-To: <201001082301.o08N1e2V019906@fed.local> User-Agent: Mutt/1.5.19 (2009-01-05) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71131 Archived-At: --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline >>> 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 > Yeah, I am stuck with ant and friends (maven2 is another tool I > am using). What do I need to load in order to use compile ? > (sorry I am really new to this). You shouldn't need any special load or require statements to use compile. Start by typing M-x compile RET. After doing so, the minibuffer will be populated with the the value of `compile-command'. The default compile-command is "make -k". Putting (setq compile-command "ant -find build.xml ") into ~/.emacs changes the value of compile-command, so that M-x compile offers "ant -find build.xml ", instead of "make -k". Once "ant -find build.xml" appears in the minibuffer, you can do one of two things: press RETURN; or, provide additional command-line arguments to ant (e.g., a build.xml target) and press RETURN. Once you press RETURN, emacs runs ant, and the output goes to the *Compilation* buffer. >> - 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 > Ok. If you've set ANT_ARGS=-emacs, then compile will be able to parse the file/line location of each error. Use C-x ` to iterate over the errors. Then compile again :) I also have (define-key ctl-x-map "\^M" 'compile) so that I can start a compilation with C-x RETURN. But that's just a personal preference. >> - 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). > What does this mean ? I have to add an ant task in my build > system ? Can't I just invoke checkstyle through emacs on a buffer Whenever I use syntax-checkers, etc. on a project, I've always set up build.xml targets for them. Having a build.xml target usually makes the process very easy to automate. Once I've written the ant task for automation, then those ant tasks become the natural way to run the syntax checkers interactively. (They're just different compile targets.) This is just my personal preference. It's been a very long time since I've used checkstyle, but there is an ant task available [1], if you want to try that approach. There may be a way to "just run checkstyle on a buffer", but I don't have an easy recipie for doing so. > What about JDEE ? Did you ever test it ? Sounds like something > for a serious java coder (which I am not ;)). Sorry, I've never tried JDEE. Steve [1] http://checkstyle.sourceforge.net/anttask.html --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (Darwin) iEYEARECAAYFAktH07QACgkQX7YJI4BuyDSRNQCfU4J4psSb6FNvYAQHSI28jEwh IZ4An07oLQZCb+Zb6QrObl3McJ6sMCGP =XRMT -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--