Re: javac task problem in Java 6

2008-11-05 Thread Sergey Bondarenko
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:











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]
>
>


Re: javac task problem in Java 6

2008-11-04 Thread Sergey Bondarenko
Well, I tried javac:

javac -sourcepath A.java -classpath b.jar A.java
It works properly in both JDK 5 and 6.

But Ant's javac task with "includes" and "excludes" does not work with JDK
6.

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?

Regards,
Sergey Bondarenko.


2008/11/4 Jess Holle <[EMAIL PROTECTED]>

> I am rather certain this is a javac bug -- though it would be good to
> /prove /that from a javac command line so as to get some focus on the real
> issue here.
>
> I believe Sun should take this particular issue seriously.  We've seen this
> before where A depends on B which /internally/ depends upon C and then
> suddenly one has to have C around to compile A.  That extends compilation
> dependencies across decoupling points one designs in and breaks library
> opacity / encapsulation.  This whole issue needs to be taken seriously and
> nailed by Sun.  It impacts Ant, of course, but this in turn impacts
> NetBeans.  It also impacts everything that uses their compiler rather than
> JDT.  Overall this issue should not be tolerated.
>
> --
> Jess Holle
>
>
> Stefan Bodewig wrote:
>
>> On Tue, 4 Nov 2008, Sergey Bondarenko <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> Regarding compilation issue, it looks like Ant javac task does not
>>> handle "includes" and "excludes" attributes correctly when it is
>>> used with JDK 6.  But it works properly with JDK 5.
>>>
>>>
>>
>> Uhm, no.
>>
>> includes/excludes controls which source files are being sent to
>> javac's command line.  If javac decides that it needs to compile
>> additional classes that it can find inside the source path, then there
>> is nothing that Ant can do.
>>
>> Inside the manual page for the javac task you will find (under
>> examples):
>>
>> ,
>> | If you wish to compile only files explicitly specified and disable
>> | javac's default searching mechanism then you can unset the sourcepath
>> | attribute:
>> | |   > |  destdir="${build}" >
>> | 
>> | 
>> |   
>> | | That way the javac will compile all java source files under "${src}"
>> | directory but skip the examples. The compiler will even produce errors
>> | if some of the non-example files refers to them.
>> `
>>
>> Stefan
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>
>


Re: javac task problem in Java 6

2008-11-01 Thread Sergey Bondarenko
Any new regarding this issue?

Thanks!

Sergey.

2008/10/30 Sergey Bondarenko <[EMAIL PROTECTED]>

> Hi dear Ant developers!
>
>
> I think I found a bug in Ant javac task, (or maybe in Java compiler).
> I need you help to check if it is true.
>
> Javac task behaves differently in Java 6 and Java 5.
> For some reason it works properly in Java 5 on the same project structure,
> but fails in Java 6.
>
> Imagine situation when you have 3 classes with dependencies between them:
> A -> B -> C
>
> Then you compile C.java and pack into c.jar
> Then you compile B.java, using c.jar in classpath, and pack it into b.jar
>
> Then you compile A.java, using b.jar.
>
> It works properly in Java 5, but fails in Java 6: compiler can not resolve
> dependency B->C (though you compile only A class).
>
>
> I created simple test case, so could you please look at it and try to find
> out the cause of the problem?
> http://download.cl1p.net/javac_bug/?FILE=17647
> There are two bat-files in archive: works.bat and fails.bat. The only
> difference between them is JDK version.
>
> I tried on Ant 1.7.1 and 1.6.5, using jdk1.6.0_10 and jdk1.5.0_16.
> The result is stable: compilation works on JDK 5, and fails on JDK 6.
>
> Any help is appreciated.
> Thanks!
>
>
> Regards,
> Sergey Bondarenko.
>


javac task problem in Java 6

2008-10-30 Thread Sergey Bondarenko
Hi dear Ant developers!


I think I found a bug in Ant javac task, (or maybe in Java compiler).
I need you help to check if it is true.

Javac task behaves differently in Java 6 and Java 5.
For some reason it works properly in Java 5 on the same project structure,
but fails in Java 6.

Imagine situation when you have 3 classes with dependencies between them:
A -> B -> C

Then you compile C.java and pack into c.jar
Then you compile B.java, using c.jar in classpath, and pack it into b.jar

Then you compile A.java, using b.jar.

It works properly in Java 5, but fails in Java 6: compiler can not resolve
dependency B->C (though you compile only A class).


I created simple test case, so could you please look at it and try to find
out the cause of the problem?
http://download.cl1p.net/javac_bug/?FILE=17647
There are two bat-files in archive: works.bat and fails.bat. The only
difference between them is JDK version.

I tried on Ant 1.7.1 and 1.6.5, using jdk1.6.0_10 and jdk1.5.0_16.
The result is stable: compilation works on JDK 5, and fails on JDK 6.

Any help is appreciated.
Thanks!


Regards,
Sergey Bondarenko.