出现错误无法找到或加载主类 org.testng.TestNG [英] Getting error Could not find or load main class org.testng.TestNG
问题描述
我正在尝试从命令行运行 TestNG
,但它给了我错误.谁能告诉我哪里出错了?
java -cp C:/TestNG 目录/testng-6.2.jar;C:project 目录srccomsuitessuiteshop org.testng.TestNG testng.xml
错误:无法找到或加载主类 org.testng.TestNG
当我从 eclipse testng 插件
运行脚本时,我的脚本运行良好.
将以下命令复制到文本文件中.
编辑位置.
另存为
yourtext.bat
现在,双击创建的批处理文件.
<块引用>
cd C:Workspaceprojectname
java -cp C:Workspaceprojectnamelib*;C:Workspaceprojectnamein org.testng.TestNG testng.xml
I'm trying to run TestNG
from command line, but it's giving me error.
Can someone tell me where am I going wrong?
java -cp C:/TestNG directory/testng-6.2.jar;C:project directorysrccomsuitessuiteshop org.testng.TestNG testng.xml
Error: Could not find or load main class org.testng.TestNG
My scripts runs fine when I ran them from eclipse testng plugin
.
Copy the below commands in a text file.
Edit the location.
Save it as
yourtext.bat
Now, double click on the batch file created.
cd C:Workspaceprojectname
java -cp C:Workspaceprojectnamelib*;C:Workspaceprojectnamein org.testng.TestNG testng.xml
这篇关于出现错误无法找到或加载主类 org.testng.TestNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!