ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shigemoto FUJIKURA <fujik...@ogis-international.com>
Subject Re: javac task
Date Wed, 23 Feb 2005 01:50:36 GMT
hi,

thnx James and Sujeet for giving me your comments.
i tried all of your suggestions but they didnt work. same 
compilation error occurs... im sure that javac task execute javac 
with arguments which i expect, srcpath, classpath and destination 
dir.

i realized one more thing.
when i set verbose option on both of javac task and javac executed 
by exec task. pre-compiler or something like that displays 
messages saying it loads classes from jar file.

when i greped those output message with "Zzz"(this is a class name 
that compiler cannot find at compilation time) and i found one 
line of each.

this is a javac task message:
[javac] [loading /home/lib/aaa.jar(hhh/iii/Jjj$Zzz.class)]

this is a javac executed by exec task message:
[exec] [loading /home/lib/aaa.jar(xxx/yyy/Zzz.class)]

i think that the pre-compiler of javac task doesnt load correct 
class for "Zzz". it load wrong class that is a inner class of Jjj 
but has same name "Zzz". then refering that wrong class for 
compilation might cause compilation error.
the reason why i thought is that there are not any other lines 
about Zzz in javac tasks output.

on the other hand, javac executed by exec task loads correct Zzz 
class from jar file.


can everyone figure out what causes the difference of loading 
message?


regards,
sigemoto.


> Hello Shigemoto
> 
> Yeah, that's a weird problem I faced a lot. You can try the following:
> 1. add the complete path of aaa.jar and bbb.jar in your environment
> CLASSPATH.
> 2.  Make it as
>  <classpath>
>        <pathelement path="${lib}"/>
>    </classpath>
> 
> - Sujeet
> ----- Original Message ----- 
> From: "Shigemoto FUJIKURA" <fujikura@ogis-international.com>
> To: <user@ant.apache.org>
> Sent: Tuesday, February 22, 2005 5:00 PM
> Subject: javac task
> 
> 
> > hi all,
> >
> > im stacking on an error which produced by javac task.
> > when i use javac task like this:
> >
> >   <javac destdir="${classes}" includeantruntime="no">
> >     <src path="${src}"/>
> >     <classpath>
> >       <pathelement path="${lib}/aaa.jar"/>
> >       <pathelement path="${lib}/bbb.jar"/>
> >     </classpath>
> >   </javac>
> >
> > the following error occurs.
> >
> > compile:
> >   [javac] Compiling 241 source files to /home/classes
> >   [javac] /home/src/Test.java:162: cannot access xxx.yyy.Zzz
> >   [javac] file xxx/yyy/Zzz.class not found
> >   [javac]              output.setMessage(qname);
> >   [javac]                      ^
> >
> > i know this compile error is NOT a classpath issue. because when i
> > execute javac by exec task with almost same args, it succeeds.
> >
> >   <property name="jars" value="${lib}/aaa.jar:${lib}/bbb.jar"/>
> >
> >   ...
> >
> >   <exec executable="javac">
> >     <arg line="-classpath ${jars} \
> >       -sourcepath ${src} \
> >       -d ${classes} \
> >       ${src}/Test.java"/>
> >
> > additionally, when i execute javac on command line, it also
> > succeeds.
> >
> >
> > does anyone know what is the difference between executing javac
> > with javac task and exec task?
> >
> >
> > Regards,
> >
> > -- 
> > sigemoto
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


-- 
sigemoto


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message