testng-eclipse icon indicating copy to clipboard operation
testng-eclipse copied to clipboard

JNI error occured

Open mosses987 opened this issue 6 years ago • 1 comments

Problem Statement

package demoAlways;

import static io.restassured.RestAssured.given;

import io.restassured.RestAssured; import io.restassured.http.ContentType; import static org.hamcrest.Matchers.equalTo;

import org.testng.annotations.Test;

public class Basement {

@Test
public void test1()
	


{
		// TODO Auto-generated method stub
	
	RestAssured.baseURI = "https://maps.googleapis.com";  

	given().
	param("location","-33.8670522,151.1957362").
	param("radius","1500").
	param("key","AIzaSyCJeDXzNibskiZJ5FkebbGRmvZVnSeTBxk").
	when().
	get("/maps/api/place/nearbysearch/json").
	then().assertThat().statusCode(200).and().contentType(ContentType.JSON).and().
	body("results[0].name",equalTo("Sydney")).and().
	body("result[0].place_id", equalTo("ChIJFfyzTTeuEmsRuMxvFyNRfbk"));
	
	

}

}

A JNI error occured. Please verify the installation

Exception Error

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

Any relate message in "Error Log" view

"Windows -> Show View -> Others -> Error Log"

The Dependency Management tool for your project

  • [ ] Maven
  • [ ] Gradle
  • [ ] Ant
  • [ ] Eclipse Buildpath (aka. Use "TestNG Library" for your project in Eclipse)

Operating System

  • [ ] Windows

mosses987 avatar Sep 05 '19 17:09 mosses987

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

could you make sure jcommander is on your classpath

missedone avatar Sep 08 '19 06:09 missedone