Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JNI error has occurred. Please check your installation

I'm trying to run a very simple test using TestNG, but I'm getting this error message. I tried reading the previous answers, but it is not working to me. I would be happy if someone could help me out, since I'm just a beginner in TestNG. This is the error message :

Exception in thread "main" 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.privateGetMethodRecursive(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.beust.jcommander.ParameterException
    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)
    ... 7 more
like image 292
Geetha P Avatar asked May 07 '15 21:05

Geetha P


1 Answers

This typically happens when your JDK version and JRE version are not compatible or when the required JRE version is not installed.

To correct the error use Window -> preferences -> compiler -> compiler compliance level and change the JRE version to existing JRE version.

like image 112
Demotte Avatar answered Oct 06 '22 06:10

Demotte