收到错误无法找到或加载主类org.testng.TestNG [英] Getting error Could not find or load main class org.testng.TestNG

查看:615
本文介绍了收到错误无法找到或加载主类org.testng.TestNG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行命令行 TestNG的,但它给我的错误。
谁能告诉我,我要去哪里错了?

java命令C:/ TestNG的目录/ TestNG的-6.2.jar; C:\\项目目录的\\ src \\ COM \\套房\\套房\\店org.testng.TestNG的testng.xml

错误:无法找到或加载主类org.testng.TestNG

我的脚本运行正常,当我从日食TestNG插件跑到他们


解决方案

  1. 在一个文本文件中复制下面的命令。


  2. 编辑的位置。


  3. 将其保存为 yourtext.bat


  4. 现在,在批处理文件双击创建。



  

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.

解决方案

  1. Copy the below commands in a text file.

  2. Edit the location.

  3. Save it as yourtext.bat

  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆