zoukankan      html  css  js  c++  java
  • 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>

    依赖关系

     




  • 相关阅读:
    Springboot + Mybatis 多数据源配置
    构建微服务:Spring boot 入门篇
    IDEA SpringBoot代码修改热部署/加载
    vue-cli知识点
    vuex知识点
    正则基本知识
    多行SQL语句拼成一条数据
    软件的版本控制
    ASP.NET 表单验证实现浅析
    建造者模式
  • 原文地址:https://www.cnblogs.com/xiaoCong2016/p/6526672.html
Copyright © 2011-2022 走看看