0

Here is a screenshot of netbeans enter image description here
Here, I have imported three jar libraries algs4.jar, stdlib.jar and acm.jar. Netbeans is importing acm finely but not importing algs4.jar and stdlib.jar. As you can see in line 3 there is no error but in line 4 it is showing error in importing, even in line 5 it is not showing algs4 and stdlib? What is going wrong here?

update: here are some more screenshots. enter image description here Here i have expanded the stdlib.jar. As you can see there is a .java file name AcyclicLP.java(first one) in that .jar.

chandola
  • 126
  • 1
  • 10
  • Does the _stdlib.jar_ actually contain a _stdlib_ package? – Voicu Oct 04 '14 at 05:13
  • I opened in archive manager. There are just a lot of .class and corresponding .java files in it. I guess no it's not a package. I want to import those classes in my program. How to do that... – chandola Oct 04 '14 at 05:18
  • You don't have to import anything in advance. Just go ahead with your code and when you use a class from one of those jar files, import it in the same way you did the `ConsoleProgram`, with the class' full qualified name. More details [here](http://docs.oracle.com/javase/tutorial/java/package/usepkgs.html) – Voicu Oct 04 '14 at 05:26
  • I tried to import that file by 'fully qualified name' method but it is still showing errors. On hovering mouse over those errors they are saying cannot find Symbol AcyclicLP... am i doing something wrong in importing or there is something else going wrong?(i have updated question, have a look at new screenshot) – chandola Oct 04 '14 at 05:48
  • 1
    [classes from default package can't be imported](http://stackoverflow.com/a/2193298/2587435). One of the reasons using default package for classes is advised/warned against by the IDE – Paul Samsotha Oct 04 '14 at 05:51
  • so if i extract all those classes in one folder and work in that folder then it should work. right? – chandola Oct 04 '14 at 06:00

0 Answers0