我正在尝试从命令提示符运行 testng.xml。这是我正在运行的命令:
C:\Users\sathmakur>java -cp C:\Users\sathmakur\.m2\repository\org\testng\testng\
6.3.1\testng-6.3.1.jar org.testng.TestNG test.xml
我收到以下错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/beust/jcommander/ ParameterException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.beust.jcommander.ParameterExcep tion
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
我是使用 TestNG 和命令提示符的新手。如果有人能提供一些启示,那将是一个很大的帮助。