On Wed, Jun 24, 2009 at 2:40 AM, dori<dorian.cus...@googlemail.com> wrote:
> Hello, i have a small ant build file that i wrote a little while ago, it's
> always worked fine but now it has started to give me errors. With the -debug
> arg i get
>
> [javac]Compiling 2 source files
> ....
> [javac]     sourcefile1.java
>    [javac]    scorcefile2.java
>    [javac] scorcefile3.java:5: package packageName does not exist
>    [javac] import packageName.className;
>
> I can see that it's compiling the sourcefile1 & 2 files, which its ment too,
> but then finds an error with source file 3 which isnt referenced by either
> sourcefile 1 or 2 and brings the total source files to compile to 3. What
> could be causing this?

Javac is "greedy", i.e. you tell it to compile some classes, it does, but
if any of those classes reference any other classes, directly or *indirectly*,
which cannot be found on the compile classpath, it attempts to locate their
sources using the compile sourcepath and compile them.

That's likely what is happening here. Tools like JDepend (being around
for a long time,
I suppose Java IDEs have the equivalent now) allow you to explore
class dependencies
in detail. I don't think this has anything to do with Ant. See what
changes in your
sources recently. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to