I\'ve downloaded two jars. I want to import some of their contained classes. How do I do this?
It\'s for my algorithms class. I\'ve tried following the instructions
If you are getting the "cannot be resolved to a type" error, and have tried adding the stdlib.jar or algs4.jar files, here is the solution:
The libraries in stdlib.jar and algs4.jar are in the "default" package. In Java, you can't access classes in the default package from a named package. If you need to use the libraries with a named package, you can use these package versions:
stdlib-package.jar and algs4-package.jar.
You can download these files here: http://algs4.cs.princeton.edu/code/
Then you can automatically add the import: import edu.princeton.cs.algs4.ClassName