ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: newbie question: javac not checking build dependencies?
Date Thu, 03 Jan 2002 15:38:58 GMT
Your mistake was in assuming that  javac actually had this dependency 
checking ability. It never did. That and Java just does not support 
separate compilation units very well as a language [for many different 
reasons, including static linking for static final constants etc].

ANT compensates for that a little bit by doing file timestamp checking, 
like most make processors can. But that does not work in many cases [like 
yours: ANT can't know that one of your classes is an extension of another 
without parsing Java]. To do everything correctly, the complete set of 
dependencies needs to be extracted from Java class definitions -- and that 
amounts to pretty much parsing everything every time, rather expensive. 

Your choices are:

- live with this javac limitation and always submit the full set of 
classes to be recompiled.
- use a different compiler with built-in dependency analysis [jikes? The 
compiler in IBM's Eclipse is pretty smart, too.]
- use some sort of a Java dependecy manager tool. They all differ in how 
smart they are. For some useful reading, check out this link [posted to 
this list a while ago]:


Please respond to "Ant Users List" <>
To:     "Ant Users List" <>

Subject:        newbie question: javac not checking build dependencies?

A quick question from someone who just started using Ant:

For some reason the javac task doesn't seem to check dependencies after it
builds. Let's say I modify a superclass to add a new abstract method, and 
leave the subclass alone. When I run javac in the command line, I get a
compile-time error when I compile, saying that the subclass needs to
implement the new method.

But when I run a javac task in Ant, it doesn't detect this. (Until it gets
to the junit task, at which point most everything fails.)

Obviously there's something really basic I'm doing wrong. Any pointers to
where I should look to figure out what to fix would be greatly 



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message