Eclipse:java.io.FileNotFoundException:(系统找不到指定的文件)
我将config添加到构建路径中的源代码列表中,但RunClass仍然抱怨无法找到该文件 它给出: java.io.FileNotFoundException: C:\Users\asdf\eclipse workspace\NG\xml.xml( 系统找不到指定的文件)Eclipse:java.io.FileNotFoundException:(系统找不到指定的文件),java,eclipse,testng,filenotfoundexception,buildpath,Java,Eclipse,Testng,Filenotfoundexception,Buildpath,我将config添加到构建路径中的源代码列表中,但RunClass仍然抱怨无法找到该文件 它给出: java.io.FileNotFoundException: C:\Users\asdf\eclipse workspace\NG\xml.xml( 系统找不到指定的文件) 为什么您认为构建路径与您得到的错误有关?是什么代码导致了这个错误?@JBNizet我指的是这个类似的帖子@ArvindKumarAvinash这个xml文件肯定在项目中,只是不在默认的src文件夹中。它是config->pkg
为什么您认为构建路径与您得到的错误有关?是什么代码导致了这个错误?@JBNizet我指的是这个类似的帖子@ArvindKumarAvinash这个xml文件肯定在项目中,只是不在默认的src文件夹中。它是config->pkg->[RunClass,xml.xml]你链接到的问题和你的一样,不包含任何代码。为了能够解释代码为何会以这种方式运行,我们需要查看该代码。发布代码。@JBNizet已添加到我的原始帖子中
public class RunTests {
public static void main(String[] args) {
TestNG testNG = new TestNG();
List<String> suites = Lists.newArrayList();
File xml = new File("xml.xml");
suites.add(xml.getAbsolutePath());
testNG.setTestSuites(suites);
testNG.run();
}
}
ProjectName
src
config
pkg
RunClass
file.xml