收到错误无法找到或加载主类org.testng.TestNG [英] Getting error Could not find or load main class org.testng.TestNG
问题描述
我试图运行命令行 TestNG的
,但它给我的错误。
谁能告诉我,我要去哪里错了?
java命令C:/ TestNG的目录/ TestNG的-6.2.jar; C:\\项目目录的\\ src \\ COM \\套房\\套房\\店org.testng.TestNG的testng.xml
错误:无法找到或加载主类org.testng.TestNG
我的脚本运行正常,当我从日食TestNG插件跑到他们
。
-
在一个文本文件中复制下面的命令。
-
编辑的位置。
-
将其保存为
yourtext.bat
-
现在,在批处理文件双击创建。
CD C:\\工作区\\项目名称
java命令C:\\工作区\\项目名称\\ lib中*; C:\\工作区\\项目名称\\ BIN 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 directory\src\com\suites\suite\shop 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:\Workspace\projectname
java -cp C:\Workspace\projectname\lib*;C:\Workspace\projectname\bin org.testng.TestNG testng.xml
这篇关于收到错误无法找到或加载主类org.testng.TestNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!