TestNG
TestNG无法启动,报错:NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/remote/RemoteArgs
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.testng.remote.RemoteArgs
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more
解决方法:
我用的是最新版的TestNG-> 6.10版本,换成 6.8 就可以了。
如果是用Maven 管理Java的jar包的话,像这样写:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<!--最新版本6.10 和 5.8 都有BUG,启动不了,提示找不到入口-->
<scope>test</scope>
</dependency>
依赖关系
![](https://images2015.cnblogs.com/blog/824039/201703/824039-20170309172016813-1806862518.png)
posted on 2017-03-09 17:17 xiaoCong2015 阅读(1161) 评论(0) 编辑 收藏 举报