Error: A JNI error has occurred, please check your installation and try again. Using Eclipse, TestNG

前端 未结 1 1130
一整个雨季
一整个雨季 2021-01-21 16:22

Using Eclipse on Mac OS, I\'m trying to run simple code to test one testNG code(later to use with Jenkins):

package demoJenkins;

import org.junit.Test;

public          


        
相关标签:
1条回答
  • 2021-01-21 16:39

    Not sure how do you setup your eclipse project, but according to the error msg, the TestNG is missing on runtime classpath.

    1. correctly setup your eclipse project and classpath.

      1a. it's recommended to use dependency management tool like Maven or Gradle.

      1b. otherwise, you need to add TestNG to your project: right click your project -> Build Path -> Add Libraries -> select "TestNG" -> now you will see TestNG and it's dependencies jars on the Project Explorer view.

    2. right click on your test class, select "Run As -> TestNG"
    3. if the error remain, please double check the classpath of the launch configuration: "Run -> Run configurations..." -> navigate to the right launch configuration -> switch to tab "Classpath", double check TestNG and the dependencies are in the entries list.

    If still can't solve the issue, please attach a reproducible sample project.

    0 讨论(0)
提交回复
热议问题