Trace class dependency at compiletime

Hi!

I am experiencing an irritating problem - some packages are automatically compiled that I haven't specified, of course because something that I am compiling references these other packages.

The package i am compiling (using ant) is meant for a plugin 1.3 enabled browser and some of my other packages contain 1.5 specific code (generics). I am therefore trying to compile the client packages with the -source 1.3 flag to the compiler but it breaks on the 1.5 specific code. Now to my problem: I can't find the code that is referencing the 1.5 packages!

Is there a way to trace the depencies at compile-time? (So that I can step backwards in that trace to see which source is doing the referencing of the unwanted packages)

Best regards,

Marcus

[786 byte] By [M_Hjortzena] at [2007-10-1 22:36:20]
# 1
Try the -verbose option of javac.Ant has a depend task that generates the dependency info. It is used for determining out of date source files but I have used it for identifying dependencies in general.
hemal.pandyaa at 2007-7-13 14:35:51 > top of Java-index,Developer Tools,Java Compiler...
# 2
If you temporarily move (rename) the "offending" class/jar/directory,the compiler can no longer find them and will complain...
tschodta at 2007-7-13 14:35:52 > top of Java-index,Developer Tools,Java Compiler...
# 3

Thank you for your replies.

The method of removing classes wasn't really a good option, that would cause the ant-task to break earlier than where I was having my problems.

However, after half an hour studying of the output from -verbose I finally found the class! (A stupid import statement that caused the entire package to eventually compile).

The -verbose option really makes a lot of conversation ;-)

It took quite a while to find it but finally I can run my 1.3 client again!

/Marcus

M_Hjortzena at 2007-7-13 14:35:52 > top of Java-index,Developer Tools,Java Compiler...