ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei" <and...@netrom.ro>
Subject Re: Ant Task - Details - failed to set the class path
Date Tue, 19 Aug 2003 08:36:11 GMT
    Dear Simon,
            I did not succed setting the class path. I made a jar with the
class. Its location is
    d:\work\uni-d\main\build\mytask.jar

package for the MyVeryOwnTask is netrom so we have
classname="netrom.MyVeryOwnTask"

what should i write to class path?



----- Original Message -----
From: "Simon Bretin" <simon@anyware-tech.com>
To: "Ant Users List" <user@ant.apache.org>
Sent: Tuesday, August 19, 2003 9:51 AM
Subject: Re: Ant Task - Details


> Hi Andrei,
>
> This means that the class you implemented is not available in the
classpath.
>
> Either you change your setup so that your be.unid.generate package is
> available within your system classpath,
> Either you slightly modify your <taskdef> definition, and add a
> classpath child note containing this package.
>
> Hope this helps,
>
> Simon.
>
> Andrei wrote:
>
> >        Simon, i 've already done that, but i think something missing.
> >This is what i've done so far.
> >
> >        I have a project containing the package  be.unid.generate and i
want to write an Ant Task to perform some things. I made a class named
> >MyVeryOwnTask in the package extending the Task class.
> >
> >Here is the class code:
> >
> >
> >package be.unid.generate;
> >
> >import org.apache.tools.ant.BuildException;
> >import org.apache.tools.ant.Task;
> >
> >public class MyVeryOwnTask extends Task {
> >    private String msg;
> >
> >    // The method executing the task
> >    public void execute() throws BuildException {
> >        System.out.println(msg);
> >    }
> >
> >    // The setter for the "message" attribute
> >    public void setMessage(String msg) {
> >        this.msg = msg;
> >    }
> >}
> >
> >        In the Build File I added at the bigining the following:
> >
> >
> >         <taskdef name="mytask"
> >            classname="be.unid.generate.MyVeryOwnTask"
> >         />
> >
> >
> >and the target:
> >
> >    <target name="task">
> >      <mytask message="Hello World! MyVeryOwnTask works!"/>
> >    </target>
> >
> >and at build time i get the error :
> >
> >taskdef class be.unid.generate.MyVeryOwnTask cannot be found and build
process stops
> >
> >
> >What this means and what can i do?
> >
> >
> >
Andrei
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message