Problem with ant javac task not finding interface dependence

C

Collin VanDyck

Hello!

This is a curiosity which I cannot off the top of my head explain. In a
very simple way, I have one class that implements an interface which
defines a static final constant; we'll call that constant "DB_VERSION".

My class that implements this interface explicitly references this
DB_VERSION and uses it in its instance methods.

If I make a change to that interface, incrementing the DB_VERSION,
apparently my ant javac task will recompile the interface correctly, but
at runtime the class that implemented the interface will still be using
the older value for DB_VERSION.

I can, of course, fix this by cleaning out the previous build files, but
that takes a while.

Is there a setting I can set on javac to find this dependency between my
object and the interface and compile both?

Thanks
Collin
 
G

Gerard Krupa

Collin said:
...
If I make a change to that interface, incrementing the DB_VERSION,
apparently my ant javac task will recompile the interface correctly, but
at runtime the class that implemented the interface will still be using
the older value for DB_VERSION.

I can, of course, fix this by cleaning out the previous build files, but
that takes a while.

Is there a setting I can set on javac to find this dependency between my
object and the interface and compile both?

IMHO the most effective solution is to use javamake (this can be plugged
into Ant as a task similar to javac). It has extremely powerful
dependency tracking facilities to deal with changes exactly like those
that you describe. I find it more effective for incremental builds,
though not as quick or fully-featured as the other main alternative -
IBM's Jikes compiler.

Neither of these compilers have complete support for J2SE 5.0 yet.
Jikes has limited support for the new language features and AFAIK
javamake just won't work at all.

http://www.experimentalstuff.com/Technologies/JavaMake/
http://developers.sun.com/dev/coolstuff/javamake/

http://www-124.ibm.com/developerworks/oss/jikes/

HTH

Gerard
 
C

Collin VanDyck

IMHO the most effective solution is to use javamake (this can be plugged
into Ant as a task similar to javac). It has extremely powerful
dependency tracking facilities to deal with changes exactly like those
that you describe. I find it more effective for incremental builds,
though not as quick or fully-featured as the other main alternative -
IBM's Jikes compiler.

Neither of these compilers have complete support for J2SE 5.0 yet. Jikes
has limited support for the new language features and AFAIK javamake
just won't work at all.

http://www.experimentalstuff.com/Technologies/JavaMake/
http://developers.sun.com/dev/coolstuff/javamake/

http://www-124.ibm.com/developerworks/oss/jikes/

HTH

Gerard

That's really helpful, thanks :) I am probably committed to staying
with 1.4 for now, so this is probably just what I'm looking for. I
appreciate it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top