ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Bondarenko" <ente...@gmail.com>
Subject Re: javac task problem in Java 6
Date Wed, 05 Nov 2008 11:27:28 GMT
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 <bodewig@apache.org>

> On Tue, 4 Nov 2008, Sergey Bondarenko <enterit@gmail.com> 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: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message