1

ErrorOccuredDuringInitializationofbootlayer I keep getting this error when I run my test:

Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar Caused by: java.lang.IllegalArgumentException: com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java identifier

How can I fix it?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    please post your code, not picture – frianH Aug 27 '19 at 08:12
  • Related to [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 Aug 27 '19 at 08:57

6 Answers6

7

Add TestNG Library to classpath in buildpath ( not to module path). It will work fine.

5

To avoid this error, do not add TestNG library in the project or src folder. Try adding it into the package. To do so , follow the below mentioned procedure.

Right click on the package, click Build Path->Configure Build Path, go to Libraries tab, select Classpath and click on Add Library to select TestNG.

Shiva Kumar
  • 51
  • 1
  • 2
0

This error message...

Error occurred during initialization of boot layer java.lang.module.FindException: 
Unable to derive module descriptor for C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar 
Caused by: java.lang.IllegalArgumentException: com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java identifier

...implies that there was an issue with the java classpath.

As per the discussion Launch with java 11 fails: Error: Could not find or load main class with Caused by: java.lang.ClassNotFoundException: with there are some issues with some particular classpaths for and the launch fails if:

  • The classpath contains a folder with spaces
  • The classpath length is larger than 32767 characters.

Where as works fine.


Reference

Unable to import org.openqa.selenium.WebDriver using Selenium and Java 11


Outro

Eclipse plugin: TestNG testcase does not run with Jdk11

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
0
  1. Need to add 1.8 version library
  2. Remove TestNG from build path library and add again
  3. Recheck - the issue should be resolved.
0

I got same issue and I solved it. When creating the project, don't create module-info.java. When the project was already created with the module-info.java, deleting this file didn't help me.

I just created new project without module-info.java, and all works good now.

David
  • 567
  • 4
  • 16
Islam
  • 1
0

Best option to resolve this:

  1. Find all file and folder starting with . e.g. — .metadata / .setting and delete them.
  2. Add all the JARS.
  3. Add testNG Libraries.
  4. Execute it.

Done.

James Risner
  • 5,451
  • 11
  • 25
  • 47