On Wed, 5 Nov 2008, Sergey Bondarenko <[EMAIL PROTECTED]> 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 A.java
> 
> 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 A.java

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

javac -d . -classpath b.jar A.java

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.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to