I got it to work with Ant 1.4 with JDK 1.3.1 on Win2k. Is ${project} defined and pointing to the right place?
Is ${project}/tools/ant/lib/optional.jar" the correct location for where you moved the jar to? Try running your build with -verbose and -debug to see if you can get any more information from that. -- Jill ----- Original Message ----- From: "William Ferguson" <[EMAIL PROTECTED]> To: "'Ant Users List'" <[EMAIL PROTECTED]> Sent: Monday, December 10, 2001 2:27 PM Subject: RE: Setting classpath for Taskdef > The task and the taskdef both have the exact same case 'mimeMail'. > > > -----Original Message----- > > From: Jill Stephenson [mailto:[EMAIL PROTECTED]] > > Sent: Monday, 10 December 2001 14:52 > > To: Ant Users List > > Subject: Re: Setting classpath for Taskdef > > > > > > Try changing the name of the taskdef to be all lowercase, it > > seems like the case of the task definition and actual usage of > > the task must match ... > > > > -- > > Jill > > > > > > ----- Original Message ----- > > From: "William Ferguson" <[EMAIL PROTECTED]> > > To: "'Ant Users List'" <[EMAIL PROTECTED]> > > Sent: Monday, December 10, 2001 12:29 PM > > Subject: RE: Setting classpath for Taskdef > > > > > > > OK. > > > > > > 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. > > > > > > ie > > > > > > <taskdef name="mimeMail" > > > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail"> > > > <classpath> > > > <pathelement location="${project}/lib/j2ee/j2ee.jar"/> > > > <pathelement location="${project}/tools/ant/lib/optional.jar"/> > > > </classpath> > > > </taskdef> > > > > > > Gives > > > > > > D:\source\main\buildScripts\NightlyBuild.xml:44: taskdef class > > > org.apache.tools.ant.taskdefs.optional.net.MimeMail cannot be found > > > at > > > > > org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:176) > > > at > > org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:114) > > > > > > etc > > > > > > 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 > > > at org.apache.tools.ant.Project.createTask(Project.java:509) > > > at > > > > > org.apache.tools.ant.UnknownElement.makeTask(UnknownElement.java:148) > > > at > > > > > org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElem > > ent.java:83) > > > at org.apache.tools.ant.Task.perform(Task.java:216) > > > > > > > > > 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 > > > attribute. > > > > > > 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. > > > > > > William > > > > > > > > > > -----Original Message----- > > > > From: Steve Loughran [mailto:[EMAIL PROTECTED]] > > > > Sent: Monday, 10 December 2001 12:55 > > > > To: Ant Users List > > > > Subject: Re: Setting classpath for Taskdef > > > > > > > > > > > > > > > > ----- Original Message ----- > > > > From: "William Ferguson" <[EMAIL PROTECTED]> > > > > To: "'Ant Users List'" <[EMAIL PROTECTED]> > > > > 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: > > > > <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]> > > > > > > > > > -------------------------------------------------------------- > > --------------------- > > > > The contents of this message are the views of the Author and > > do not necessarily reflect the views of SUNCORP METWAY LTD > > ABN 66 010 831 722. > > > > The content of this e-mail, including attachments is a > > confidential communication between the Suncorp Metway Group > > and the intended addressee. Any unauthorised use of the > > contents is expressly prohibited. If you have received this > > e-mail in error please contact the sender immediately and > > then delete the message and any attachment(s). > > > > http://www.suncorpmetway.com.au > > > > > > -- > > 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]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>