0

I tried in two popular IDEs, eclipse and netbeans, to import a jar file named stdlib which contains a bunch of stuff. StdDraw is part of it but even after referencing it, the IDEs keep telling me it doesn't exist when I use their methods.

I have browsed stackoverflow and read other questions/answers and followed instructions to the letter. So why is this not working?

Noel
  • 966
  • 1
  • 9
  • 19

1 Answers1

1

That jar file puts classes in the default package. ( a terrible idea)

To use it you have two options:

  1. Put all of your files that access it in the default package
  2. Use the alternative version of the library (http://introcs.cs.princeton.edu/java/stdlib/stdlib-package.jar)

See Adding Default Package's Classes in NetBeans

Community
  • 1
  • 1
WillShackleford
  • 6,918
  • 2
  • 17
  • 33