Exception in thread "main" java.lang.NoSuchMethodError: org.testng.TestNG.configure(Lorg/testng/CommandLineArgs;)V

时间:2021-03-25 02:43:32

TestNG运行时报以下错误:

Exception in thread "main" java.lang.NoSuchMethodError: org.testng.TestNG.configure(Lorg/testng/CommandLineArgs;)V
at org.testng.remote.AbstractRemoteTestNG.configure(AbstractRemoteTestNG.java:77)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:214)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/CommandLineArgs
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:41)
Caused by: java.lang.ClassNotFoundException: org.testng.CommandLineArgs
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)
... 1 more