0

I am getting error when i trying to run TestNG project with Java 11 through Eclipse

Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\ShefaliBajaj\Downloads\eclipse-java-2018-12-R-win32-x86_64\eclipse\plugins\org.testng_6.14.3.r201802240500.jar Caused by: java.lang.IllegalArgumentException: org.testng.6.14.3.r201802240500: Invalid module name: '6' is not a Java identifier

Any advice how this can be fixed?

Earlier i was getting some 'Build path contains duplicate entry:'org.testng_TESTNG Container' for project error. so to fix this i removed module info.java file and run the project and got above error

This is my first TestNG code-

package testng;

import org.testng.annotations.Test;

public class TestNGBasics {

    @Test
    public void Demo()
    {
        System.out.println("hello");
    }
}
Naman
  • 27,789
  • 26
  • 218
  • 353
  • Does this answer your question? [Unable to derive module descriptor for auto generated module names in Java 9?](https://stackoverflow.com/questions/46501388/unable-to-derive-module-descriptor-for-auto-generated-module-names-in-java-9) – Naman Sep 30 '20 at 14:06

3 Answers3

0

This error occurs because you can not add TestNG on your eclipse. Kindly install the plugin from eclipse marketplace. steps are given below:

 1. Click on Help.
 2. Click on eclipse marketplace
 3. Type TestNG + Enter
 4. Install "TestNG for Eclipse"
 5. After installation re-launch eclipse

Now it's working fine.

Amit Singh
  • 121
  • 5
0

This error occurs because TestNG plugin is not installed on your Eclipse IDE. TestNG may not be available on Eclipse Marketplace for all versions of Eclipse IDE.

To install TestNG:

1. Go to Help > Install New Software... > Add...
2. Name: TestNG Eclipse
3. Location: dl.bintray.com/testng-team/testng-eclipse-release/
Hanzla
  • 214
  • 5
  • 15
0

This Error Occurs usually due to the Java version we are using.

Follow the steps

  1. Check for jre-1.8 in build path. If it is showing jre-1.5 then remove it.
  2. Click on Add Library and then select JavaSystemLibrary
  3. Click Next and choose Execution environment.
  4. Select jre-1.8 or more from the dropdown.
  5. Finish

enter image description here