ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject RE: classpath task not found error
Date Thu, 09 Aug 2001 00:31:54 GMT
You can't set the "global" classpath in Ant in this way. You must explicitly
say what classpath you want to use for each particular task that supports a
classpath, such as <javac>, <java> etc.

i.e
 <path id="foo">
   ...
 </path>

 <path id="bar">
   ...
 </path>

 <javac ...>
    <classpath refid="foo"/>
 </javac>

 <java ...>
   <classpath refid="boo"/>
 </java>

There is no <classpath> element at the top level - only nested within other
tasks.

Conor


> -----Original Message-----
> From: T Master [mailto:tmaster@iknowledgeinc.com]
> Sent: Thursday, 9 August 2001 10:04 AM
> To: ant user mailist
> Subject: classpath task not found error
>
>
> In my build file, i have a <classpath> declared inside my init target:
>     <classpath refid="project.class.path"/>
>
> The path declaration is as follows:
>     <path id="project.class.path">
>         <pathelement path="${java.class.path}"/>
>         <fileset dir="${lib.build.dir}">
>             <include name="*.jar"/>
>             <include name="*.java"/>
>         </fileset>
>     </path>
>
> The error message is below.  Why can ant not find the <classpath> task?  I
> copied the code from the user manual example.
>
> Using: ant1.3, win2k.
>
> T Master.
>
> OUTPUT:
>
> prompt:/cygdrive/c/dev/build/$>ant.bat init
> Buildfile: build.xml
>
> init:
>
> BUILD FAILED
>
> c:\dev\build\build.xml:103: Could not create task of
> type: classpath. Common solutions are to use taskdef to declare your task,
> or, i
> f this is an optional task, to put the optional.jar in the lib
> directory of
> your
>  ant installation (ANT_HOME).
>
> Total time: 0 seconds
> prompt:/cygdrive/c/dev/build/$>
>
>


Mime
View raw message