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

2

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(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.beust.jcommander.ParameterException
    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)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 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
source

3 answers

2

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:

<dependency>
  <groupId>com.beust</groupId>
  <artifactId>jcommander</artifactId>
  <version>1.48</version>
</dependency>

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

    
answered by 18.11.2016 в 21:25
0

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
0

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