I don't have the exact error message, but the situation was this: one of
our programmers likes to code everything with generics.  The compile
problem in question involved a class using generics with an internal
class also using generics (i.e.

Public class foo <Source, Output>
{
        Static public class fooNode <SourceType, OutputType>
        {
                Blah blah...
        }
}

        So the compiler spits out a foo.class and foo$fooNode.class.
When ant  tries to compile the junit test for the class using javac,
using the class files generated by eclipse, it throws a javac error
referencing foo$fooNode.class saying that there's no definition for
"Source" (which the subclass doesn't reference) and that
foo$fooNode.class is a "bad class file" so the junit test can't compile.

        When I delete all the .class files made by eclipse and have ant
build them all, I don't get the error.

Thanks
-mark




 
This e-mail message, and any attachments, is intended only for the use of the 
individual or entity identified in the alias address of this message and may 
contain information that is confidential, privileged and subject to legal 
restrictions and penalties regarding its unauthorized disclosure and use. Any 
unauthorized review, copying, disclosure, use or distribution is strictly 
prohibited. If you have received this e-mail message in error, please notify 
the sender immediately by reply e-mail and delete this message, and any 
attachments, from your system. Thank you. 

-----Original Message-----

From: Darin Swanson [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 29, 2006 3:53 PM
To: Ant Users List
Subject: RE: ant and eclipse?

If you have the exact error message I would search the javac and Eclipse

bug database and see if it is a known problem (with potential
workaround)

HTH
Darins




"Mark Modrall" <[EMAIL PROTECTED]> 
09/29/2006 12:33 PM
Please respond to
"Ant Users List"


To
"Ant Users List" <user@ant.apache.org>
cc

Subject
RE: ant and eclipse?






I found the Java Compiler section of the Properties dialog, but as I say
it doesn't help clarify why the .class files it produces are
incompatible with the jdk javac ones.

Our eclipse project has
Compiler compliance level: 5.0
Use default compliance settings

Classfile generation:
Add variable attributes to generated class files
Add line number attributes to generated classfiles
Add source file name to generated class file
Preserve unused local variables

Our ant <javac> task ends up using
Jdk1.5.0_06\javac -deprecation -d <output path> -g *.java

As I say, the net result is that the eclipse .class files won't work
with the javac ones but I'm at a loss to figure out which options are
creating the incompatibility.

Thanks
-mark



 
This e-mail message, and any attachments, is intended only for the use
of 
the individual or entity identified in the alias address of this message

and may contain information that is confidential, privileged and subject

to legal restrictions and penalties regarding its unauthorized
disclosure 
and use. Any unauthorized review, copying, disclosure, use or
distribution 
is strictly prohibited. If you have received this e-mail message in
error, 
please notify the sender immediately by reply e-mail and delete this 
message, and any attachments, from your system. Thank you. 

-----Original Message-----

From: Shay Thompson [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 29, 2006 3:16 PM
To: Ant Users List
Subject: Re: ant and eclipse?


Each Java Project in Eclipse has a JVM assigned to the project.  If you 
right-click the project name and select properties you can find it in
there.

Mark Modrall wrote:
> Not sure where I'd check that.  I know that ant is using jdk1.5.0.6
but
> I don't know how to look into what eclipse is using... 
>
> Thanks
> -mark
>
>
>
>
> 
> This e-mail message, and any attachments, is intended only for the use
of the individual or entity identified in the alias address of this
message and may contain information that is confidential, privileged and
subject to legal restrictions and penalties regarding its unauthorized
disclosure and use. Any unauthorized review, copying, disclosure, use or
distribution is strictly prohibited. If you have received this e-mail
message in error, please notify the sender immediately by reply e-mail
and delete this message, and any attachments, from your system. Thank
you. 
>
> -----Original Message-----
>
> From: Shay Thompson [mailto:[EMAIL PROTECTED] 
> Sent: Friday, September 29, 2006 2:53 PM
> To: Ant Users List
> Subject: Re: ant and eclipse?
>
>
> The first thing I'd look at is what JVM is Eclipse using to compile
the 
> code vs. what JVM is used when on the command-line.
>
> -Shay
>
> Mark Modrall wrote:
> 
>> Hi...
>>
>> 
>>
>>             We do all of our development in eclipse and use ant 1.6.5
>> for our nightly builds on another machine.  But someone just tried to
>> invoke ant to run our junit tests on his dev machine.  He went into
>> 
> the
> 
>> eclipse project directory and executed the ant build.xml file there,
>> 
> but
> 
>> the javac task on the junit tests failed with a strange compile error
>> against one of the base classes to be tested (a "bad class file"
error
>> on the use of generics).
>>
>> 
>>
>>             Finally narrowed it down to the fact that the .class
files
>> produced by eclipse aren't compatible with the class files produced
by
>> <javac>.  If I recompile the base classes from the command line using
>> javac, then the junit test compiles.  The problem is that it's hard
to
>> map what options eclipse is using to javac commandline parameters, so
>> 
> I
> 
>> can't tell what is causing the incompatibility.
>>
>> 
>>
>>             Eclipse has a Run As... option for ant projects but when
I
>> try to run it from inside eclipse, it says it doesn't know about
>> <junit>.
>>
>> 
>>
>>             First, anyone know how to tell what the two compilers
>> 
> don't
> 
>> like about each other?  And second, how does one get eclipse to run
>> 
> ant
> 
>> builds?
>>
>> 
>>
>> Thanks
>>
>> -Mark
>>
>> 
>> This e-mail message, and any attachments, is intended only for the
use
>> 
> of the individual or entity identified in the alias address of this
> message and may contain information that is confidential, privileged
and
> subject to legal restrictions and penalties regarding its unauthorized
> disclosure and use. Any unauthorized review, copying, disclosure, use
or
> distribution is strictly prohibited. If you have received this e-mail
> message in error, please notify the sender immediately by reply e-mail
> and delete this message, and any attachments, from your system. Thank
> you.
> 
>> 
>> 
>
> 

-- 

... cut twice, paste once.

Shay Thompson - Lead Computer Scientist
Adobe Systems, Inc. - Titan Core QE 
Voice: x34728 or 612.251.5415

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

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

Reply via email to