ERROR TO CORRECT MY PROJECT (Error: A JNI error has occurred, please check your installation and try again)


When I try to run my test project (Selenium and testNG) I get this error:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/beust/jcommander/ParameterException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(
    at java.lang.Class.privateGetMethodRecursive(
    at java.lang.Class.getMethod0(
    at java.lang.Class.getMethod(
    at sun.launcher.LauncherHelper.validateMainClass(
    at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: com.beust.jcommander.ParameterException
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    ... 7 more

I have already reviewed all the libraries and I have not been able to solve it yet. I appreciate what you can help me with.

asked by Laura Alvarez 29.09.2016 в 18:19

3 answers


Class ParameterException is not found:


Caused by: java.lang.ClassNotFoundException:   com.beust.jcommander.ParameterException

I think it needs to install jCommander , if you use gradle add this dependency:

compile "com.beust:jcommander:1.48"

if you use Maven add:


or use the .jar and add it to the /lib folder, you can download it here!

answered by 18.11.2016 в 21:25

Verify in jcommander.jar that that% ParameterException is there! In this case it is not for the exception that it throws, you have to look for a version of the most updated or oldest library, it depends on your project.

answered by 14.10.2016 в 21:31

Add another version of java because you may be using one that bothers you because I'm bothered by JDK 1.8. For that, I put the other one and compiled me without problems.

You click secondary to the project and you're going to run.

answered by 17.12.2016 в 01:27