Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ant:Java中的任务类路径_Java_Ant_Classpath_Task - Fatal编程技术网

ant:Java中的任务类路径

ant:Java中的任务类路径,java,ant,classpath,task,Java,Ant,Classpath,Task,我在ant中执行此操作时出错,我不明白为什么ant无法识别任务类路径: <?xml version="1.0"?> <project default="task"> <target name="task"> <classpath> <pathelement path="." /> </classpath> </target> </project> 我收到了错

我在ant中执行此操作时出错,我不明白为什么ant无法识别任务类路径:

<?xml version="1.0"?>

<project default="task">

<target name="task">
    <classpath>
        <pathelement path="." />
    </classpath>
</target>

</project>

我收到了错误消息:

task:

BUILD FAILED
C:\way\build.xml:6: Problem: failed to create task or type classpath
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
任务:
构建失败
C:\way\build.xml:6:问题:无法创建任务或类型类路径
原因:名称未定义。
措施:检查拼写。
操作:检查是否已声明任何自定义任务/类型。
措施:检查是否发生了任何/声明。

有人知道错误的来源吗?

Ant中没有
类路径
任务(即使某些任务允许您指定类路径。您可以使用
路径
任务测试基本Ant构建,作为替代:

<?xml version="1.0"?>

<project default="task">

<target name="task">
    <path id  = "class.dirs.path">
        <dirset dir  = "${build}" includes = "class.dir.list" />
    </path>
</target>
</project>