Want to keep your build file lean, mean, and totally maintainable? Marcus Zarra tells you why Jakarta’s Ant is a relatively easy-to-use way to build your projects (and how to avoid its common pitfalls).
Ant: Building a Better Build File
2005-05-08 General Development 14 Comments
Right now I have ant installed, but can’t use it. Why? Because it is allergic to my JRE. So why don’t I de install it? Because I need the JRE for Firefox. So either I’ve got no Java in Firefox (which I need) or I have no Ant (which I can live without right now).
Hope they fix it.
Allergic to your JRE?! What’s your JRE version? Never heard of such.. (until it’s 1.1 ofc
It looks for tools.jar and dosn’t find it in the JRE of course.
I’m not the only one with this problem (found some others with google).
Try adding it to the classpath explicitly, sometimes this helps.
Ugh, RTFM, or go study biology. Allergic 😉 Ha!
Why would you be using ant with the JRE? You should be using it with the JDK.
set JAVA_HOME to your jdk. c:jdk1.5.0_02 or watever is your path. I’ve encountered that same problem, its easy to fix.
They are environment variables godammit ! Environmental they are not.
…we use a customized version at work that contains several split out modules to handle our own method of building and deploying. It is really useful to have it check out the latest sources, produce builds for each specialized environment, managing build numbers on the fly, etc.
And it builds SO FAST! Way faster than using a tool like JDeveloper.
Anyway, cool article.
Then you don’t have to mess with a JVM or wait for it to load.
Firefox uses the JRE, so I have, and need the JRE and the JDK installed.
I’ll do that.
Those who don’t know yet Ant should directly use Maven (an other Apache tool) which is a more advanced tool: http://maven.apache.org/
With just a project.xml file which describes the project at a high level, it can build a distribution and a whole web site that presents useful information for developers such as code quality and tests execution reports.
ANT is primarily used as a script for Java builds. It doesn’t make sense for it to run only on top of a JRE (Java Runtime). What it needs is the JDK (Java Development Kit). Otherwise how would it build???
When JAVA_HOME is pointed to the JRE installation directory, ANT will most likely not work. It will certainly not build. For installation details, you should consult the ANT homepage. Documentation for ANT is very well written.