alchaochao 发表于 2015-4-26 17:57:05

ant执行testng时报错

在用ant执行testng时报错了,求指导
test:
    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.ParameterException
            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
    The tests failed.
BUILD SUCCESSFUL
Total time: 1 second

alchaochao 发表于 2015-5-3 12:09:57

已解决,原因是少了jcommander.jar包,加入包后重新运行OK
页: [1]
查看完整版本: ant执行testng时报错