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
27.3k17 gold badges61 silver badges102 bronze badges
asked Mar 31, 2021 at 14:50
2
  • Does this answer your question? Java 11 Unable to derive module descriptor Commented Mar 31, 2021 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 stackoverflow.com/a/51133799/421195 for suggestions. Commented Mar 31, 2021 at 15:05

1 Answer 1

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!

answered Apr 1, 2021 at 0:29
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.