Is it complaining about ${weblogic} not set properly ? I had this problem
too, when I used <path> to set a global classpath. But I couldn't access any
variables, since there's no option of using "depends="init"", in which case
the variables(${weblogic} in ur case) would be defined. The only other
option is to define the weblogic variable in the command-line argument or
try hardcoding the ${weblogic} to the actual value. 

A question regarding this issue : 

IS there anyway to reference a variable in the path element, w/o using a
command-line argument ? 

-----Original Message-----
From: Conor MacNeill [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 6:43 AM
To: Ant Users List
Subject: Re: setting classpath using classpathref attribute


Karen Davies wrote:
> Hi all,
> I've just created a simple build file, setting the classpath as follows:
> 
> <path id="test.classpath">
>       <pathelement path="${weblogic}"/>
>       <pathelement location="lib\ejb.jar"/>
> </path>
> 
> <target name="compile" depends="init" description="compile the simple
source
> files" >    
>     <javac srcdir="${src}/Lakelands/market2uutility" destdir="${build}"
> classpathref="test.classpath"/>
> </target>
> 
> However, when i run ant it does not pick up this classpath at all, it will
> only pick it up if i set is as:
> 
> <javac srcdir="${src}/Lakelands/market2uutility" destdir="${build}"
> classpath="${weblogic}\lib\ejb.jar"/>
> 

The paths in your two examples are not equivalent.

The first is a path composed of two components
    a 1 element path containing ${weblogic}
    a path location lib\ejbjar

The second is a single path with one component
    ${weblogic}\lib\ejb.jar

If you want to use the first scheme do this
<path id="test.classpath">
       <pathelement path="${weblogic}/lib/ejb.jar"/>
</path>

and you should be right.

Conor





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

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

Reply via email to