ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William Ferguson" <>
Subject RE: Setting classpath for Taskdef
Date Mon, 10 Dec 2001 02:29:11 GMT

If I remove optional.jar from %ANT_HOME%\lib but define it in the MimeMail
taskdef along with J2ee.jar,
then Ant can't find the MimeMail task.


	<taskdef name="mimeMail"
			<pathelement location="${project}/lib/j2ee/j2ee.jar"/>
			<pathelement location="${project}/tools/ant/lib/optional.jar"/>


D:\source\main\buildScripts\NightlyBuild.xml:44: taskdef class cannot be found


But if I define the taskdef for MimeMail as above and don't remove
optional.jar from %ANT_HOME%\lib then I get

D:\source\main\buildScripts\NightlyBuild.xml:172: Could not create task of
type: mimeMail due to java.lang.NoClassDefFoundError: javax/mail/Address

So it wuld seem that Ant definitely requires the optional.jar in its
classpath when executed, and can't pick it up from the taskdef classpath

It also seems that Ant requires that any libraries that are needed by an
optional task to also be included in Ant's classpath.
Ie these classes can't be specified via the classpath attribute of taskdef.

So either I'm doing something totally wrong, or the classpath attribute
doesn't appear to function.


> -----Original Message-----
> From: Steve Loughran []
> Sent: Monday, 10 December 2001 12:55
> To: Ant Users List
> Subject: Re: Setting classpath for Taskdef
> ----- Original Message -----
> From: "William Ferguson" <>
> To: "'Ant Users List'" <>
> Sent: Sunday, December 09, 2001 4:32 PM
> Subject: RE: Setting classpath for Taskdef
> > Thanks Eric,
> >
> > optional.jar is already in %ANT_HOME%\lib and it finds it OK.
> > It's just not finding j2ee.jar
> That is because the task in optional.jar is in a different
> classloader from
> the j2ee jar.
> > If I explicitly add j2ee.jar to the classpath when I invoke Ant then
> > everything works OK.
> > But that is not an optimal solution.
> It is all you get unless you pull optional.jar from ant\lib
> and include it
> in the classpath you spec for MimeMail.
> --
> To unsubscribe, e-mail:
> <>
> For additional commands, e-mail:
> <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message