I have two jar files - jar1 and jar2. Both of them are located in C: \ Eclipse \ projects, and I added the paths to both of them to the CLASSPATH environment variable as follows
.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\Eclipse projects\stdlib.jar;C:\Eclipse projects\algs4.jar
".;" at the beginning were there, so I left them. Then I added jars to the project from their project location C: \ Eclipse \, and they appeared as reference libraries. However, when I try to create an instance of a class from cans, it does not recognize it. I also can not import the jar (import jar1).
After I tried to add the lib folder to the project, I added banks there. After that, I added them again as references (so that they do not appear twice in reference libraries), however I still cannot use inner classes. Any help would be greatly appreciated.
UPDATE: Something must be wrong on my part. None of the suggestions worked for me. Here is the video with all the steps: screencast.com/t/gC81YzCsLY0e
SOLUTION In my project, I had a package called TestProject, and it seems that these banks need a default package. After removing the TestProject package and using defaultPackage, everything worked correctly after adding external JARs, as described below.
source share