1

My OS is Windows 10 and I use eclipse to write Java

I downloaded algs4.jar from the algorithm4 offical network, then used it as my project external jars, but when I try to run the program it keeps giving an error like this:

Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for C:\Users\hw\Downloads\algs4.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: TestAlgs4.class found in top-level directory (unnamed package not allowed in module)

I google the problem and tried to delete the TestAlgs4.class as the former error messages said but it did not work.

How can I fix this?

enter image description here

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Tracker647
  • 29
  • 6
  • Does this answer your question? [Java 11 Unable to derive module descriptor](https://stackoverflow.com/questions/54682417/java-11-unable-to-derive-module-descriptor) – the Hutt Mar 31 '21 at 14:54
  • There are several different things that could be causing the error. I would focus on this part: `Caused by: java.lang.module.InvalidModuleDescriptorException:... (unnamed package not allowed in module)` See https://stackoverflow.com/a/51133799/421195 for suggestions. – paulsm4 Mar 31 '21 at 15:05

1 Answers1

0

Problem solved. I was install alg4 in module path for my project,but it should install in classpath,now I can enjoy the book!

Tracker647
  • 29
  • 6