Quantcast
Channel: How do I import jars into my java program? - Stack Overflow
Viewing all articles
Browse latest Browse all 14

Answer by live-love for How do I import jars into my java program?

$
0
0

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


Viewing all articles
Browse latest Browse all 14

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>