build.xml文件:
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpathref="classpath"/>
错误提示:
taskdef A class needed by class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found: junit/framework/Test
解决方法:
在Eclipse菜单栏:window--preferences-ant -runtime-classpath-ant Home enties
单击add JARs 按钮,把junit.jar 加入即可。