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: <project default="compile"> <target name="compile"> <javac sourcepath="" srcdir = "." destdir="." includes="A.java" excludes="B.java"> <classpath> <pathelement path="b.jar"/> </classpath> </javac> </target> </project> So there is a problem in the way Ant works with javac. I understand that Ant compiles classes using tools.jar, so there is no straight way to write the same command line. But since JDK javac compiler works properly in both JDK, I suppose that something is wrong in Ant's javac task. Is it correct? BTW, did you try to compile classes from javac_issue.zip that I had sent earlier? Regards, Sergey Bondarenko. 2008/11/5 Stefan Bodewig <[EMAIL PROTECTED]> > On Tue, 4 Nov 2008, Sergey Bondarenko <[EMAIL PROTECTED]> wrote: > > > javac -sourcepath A.java -classpath b.jar A.java > > It works properly in both JDK 5 and 6. > > This is not what Ant does (and why I pointed you at sourcepath="" in > order to get something like that. > > > But Ant's javac task with "includes" and "excludes" does not work > > with JDK 6. > > See my response. > > > So I am not sure that problem is in javac compiler. It looks like > > there is a problem in javac Ant task. Could anybody please check > > it? Is there any way to look at exact javac invocation string that > > is produced for the build script? > > Run Ant with -verbose. > > Stefan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >