ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: javac task problem in Java 6
Date Wed, 05 Nov 2008 15:21:46 GMT
On Wed, 5 Nov 2008, Sergey Bondarenko <> wrote:

> Hi Stefan!
> I followed your advice and set sourcepath to "".
> Compilation by javac works properly in JDK 5 and 6:
> javac -sourcepath "" -classpath b.jar
> Compilation by ant task works properly in JDK 5, but does not work
> in JDK 6

This is not what Ant does.  Compilation looks more like

javac -d . -sourcepath . -classpath b.jar

without setting sourcepath (Ant uses srcdir as sourcepath in that
case) and

javac -d . -classpath b.jar

with sourcepath="".

The problem seems to be that destdir==srcdir in your case.  If I
create a directory d and set destdir="d" then only A gets compiled (on
Java4 as well as Java5).  It seems as if Java6's javac searches the
destination directory for sources as well.

> I understand that Ant compiles classes using tools.jar, so there is
> no straight way to write the same command line.

If you set fork="true" it will use the command line, but the
in-process execution really should look the same.


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

View raw message