• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Ant could not find the task or a class this task relies upon

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having trouble using Ant and JUnit together. This is the error I get
[CODE} Ant could not find the task or a class this task relies upon [/CODE]
Can anyone let me know what the environment variable settings should be...
Im using apache-ant-1.6.2 and Junit3.8.1...
I have apache-ant-1.6.2/bin in my path. I believe ant-junit.jar (inside \lib) is the file necessary for ant+junit to work correctly....

What am I missing ??
[ October 19, 2004: Message edited by: V Bose ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably need to put JUnit.jar into the %ANT_HOME%\lib directory (rather than just in the classpath) - there's some classpath issue with jUnit as I remember.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having the same problem. I have added the junit.jar to the ANT_HOME\lib directory, but it still doesn't work. I can run JUNIT and Ant separately but not JUnit from withing Ant.
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try copy / pasting the JUNIT.jar from the "REAL" JUnit download into the (ANT_HOME)/lib.
Try if this works ?
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran into this issue, and found some information about it being an issue with classloaders.

Here are the details:
http://ant.apache.org/faq.html#delegating-classloader

In my file, I went for pulling the ant-junit.jar out of the ant\lib and placing it in an external directory,...and then referencing that directory in my build.xml via a taskdef.

<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
<pathelement location="${tools.module.dir}/junit/lib/junit.jar"/>
<pathelement location="${tools.module.dir}/ant/lib/ant-junit.jar"/>
</classpath>
</taskdef>
 
it's a teeny, tiny, wafer thin ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic