Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After upgrading to Intellij 15 TestNG tests don't run in the IDE

I upgraded my community edition IntelliJ from version 14 to 15.0.1 and TestNG tests which used to run in the IDE give these exceptions. How do I fix these?

Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/CommandLineArgs
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:118)
    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:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.testng.CommandLineArgs
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

Let me know if more information is needed.

like image 991
Ram Avatar asked Nov 25 '15 01:11

Ram


1 Answers

The org.testng.CommandLineArgs class was introduced in TestNG 6.0. I encountered the same problem and my project had TestNG 5.9. After upgrading to a newer version tests ran successfully.

like image 186
Sanjiv Jivan Avatar answered Sep 27 '22 20:09

Sanjiv Jivan