Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.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 build.xml文件构建webdriver java代码_Java_Eclipse_Ant_Build_Webdriver - Fatal编程技术网

无法使用ant build.xml文件构建webdriver java代码

无法使用ant build.xml文件构建webdriver java代码,java,eclipse,ant,build,webdriver,Java,Eclipse,Ant,Build,Webdriver,因此,我安装了ant并尝试编写一个xml文件,并尝试构建我的webdriver java代码(在WindowsServer2003中)。但是我无法建立这个项目。它抛出了很多错误。 这是我的构建文件 <?xml version="1.0" encoding="UTF-8"?> <project default="run" name="title"> <target name="run" depends="compile"> </target> &l

因此,我安装了ant并尝试编写一个xml文件,并尝试构建我的webdriver java代码(在WindowsServer2003中)。但是我无法建立这个项目。它抛出了很多错误。 这是我的构建文件

<?xml version="1.0" encoding="UTF-8"?>

<project default="run" name="title">
<target name="run" depends="compile">
</target>
<target name="compile">
<javac includeantruntime="false" srcdir="./src" destdir="staging"/>
</target>
</project>
有人能告诉我发生了什么事吗? ^

有人能告诉我发生了什么事吗


包含相关类的Jar显然不在编译时类路径上。

添加classpath ref,如下所示

<javac includeantruntime="false" srcdir="./src" destdir="staging" 
classpathref="classpath" />


注意c;ass路径基本上是“Java101”。在你了解它是什么以及如何使用它之前,最好避开复杂的第三方项目。您是否已将selenium java jar文件添加到类路径中?我已将G:\eclipse\selenium-2.33.0\selenium-java-2.33.0.jar添加到path变量中。我最终遇到了以下错误:G:\Documents and Settings\Administrator\eworkspace\Sample\build.xml:9:未找到引用类路径。有人能解释一下具体的错误吗正在进行吗?然后,请将
G:\eclipse\selenium-2.33.0\selenium-java-2.33.0.jar
添加到环境变量中的CLASSPATH变量中。我添加了类似
的内容,这样错误就消失了。但它在代码中显示了16个其他错误,如
:16:error:package org.testng不存在[javac]import org.testng.Assert那么我需要在selenium中添加所有JAR文件吗?我只得到这个包的错误16:错误:包org.testng不存在[javac]import org.testng.Assert;[javac]^
<javac includeantruntime="false" srcdir="./src" destdir="staging" 
classpathref="classpath" />