ANT & ANTENNA
July 4, 2008 by ovidiuMost programmers, if not all, have heard about the C++ utility ‘make’. It’s purpose is simple: to aid in the configuration, compilation and deployment of C++ based applications. Make is used by creating makefiles which describe all the sets the above operations require. Then, instead of typing away countless commands at the command prompt, you simply invoke ‘make’ and let it take care of the dirty stuff. This saves time and eliminates a lot of possible errors, but it barely scratches the surface of what ‘make’ can do. And, guess what, there’s a Java equivalent for ‘make’. It’s name is
ANT is an acronym for “Another Neat Tool”. ANT is 100% written in Java and, unlike make, uses XML-based configuration files. This makes editing ANT configuration files a lot easier than editing MAKE configuration files, and a lot less error-prone. ANT is mostly used for one-line compiling and building. However, ANT can do much more. It allows you to build applications for different platforms and configurations, to include different sources for different targets, to automatically run JUnit test and in general control the entire workflow of the building and compiling process.
ANT is really easy to pick up and use. There’s a great tutorial over at http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html , so I won’t give you a How-To here. Furthermore, you’ll rarely work with ANT itself, since all major Java IDEs have built-in support for
ANT was built with desktop Java in mind. And while it’s more than suitable for using with J2ME projects, there’s a little extra add-on, called ANTENNA, that provides support for J2ME specific tasks. For instance, it can remove unused classes from JAR files, automatically sign MIDlets, automatically modify JAD files and more. It is a great addition for J2ME developers.
To my knowledge, ANTENNA is not integrated with NetBeans (although Eclipse supports it). However, the NetBeans Mobility Pack already offers almost everything ANTENNA offers (perhaps with the exception of generating code specific for the Blackberry and Palm OS). And if you really want to, you can integrate ANTENNA with NetBeans also. There’s a tutorial on the subject available here: http://www.indicthreads.com/blogs/154/Ant_Antenna_NetBeans.html .
ANT and ANTENNA are two of the most time-saving Java tools in existence. They help you focus more on meaningful tasks, such as coding, and less on more menial tasks, such as actually compiling, linking and deploying your application. Without them, a Java developer’s life simply wouldn’t be the same.

You must be logged in to post a comment.