How to solve “Cause: the class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found.” while running “ant test”?
问题 I have a target named test and I want to do some tests. I put here the important parts in build.xml . It includes: <property name='lib.dir' value='lib' /> <path id='classpath'> <fileset dir="${lib.dir}" includes="**/*.jar" /> </path> And I have put the junit.jar and ant-junit.jar (is it a must?) in the lib directory. However, if I run ant test . The output error is: test: BUILD FAILED /home/xiaohan/EclipseWorkSpace/AntTest/build.xml:82: Problem: failed to create task or type junit Cause: the