title: Confused on how to run the Sedgewick textbook libraries
body: <p>I ran the Mac installer here:</p>
  
  <p><a href="http://algs4.cs.princeton.edu/code/" rel="nofollow noreferrer">http://algs4.cs.princeton.edu/code/</a></p>
  
  <p>which says</p>
  
  <p>The Mac OS X installer downloads algs4.jar to the /Users/username/algs4 folder; adds it to the DrJava classpath; and provides the wrapper scripts javac-algs4 and java-algs4, which classpath in algs4.jar, for use in the Terminal.</p>
  
  <p>I don't see an algs4 folder created in Users/username..not sure whats going on here.</p>
  
  <p>Q. What is the easiest way to execute the main() method in classes that are contained in algs4.jar?</p>
  
  <p>A. If you used our autoinstaller, you can execute with a command like</p>
  
  <pre><code>% java-algs4 edu.princeton.cs.algs4.StdDraw
  </code></pre>
  
  <p>This command works:</p>
  
  <pre><code>java-algs4 edu.princeton.cs.algs4.StdDraw
  </code></pre>
  
  <p>but when i try to run</p>
  
  <pre><code>java-algs4 edu.princeton.cs.algs4.Counter
  </code></pre>
  
  <p>or</p>
  
  <pre><code>java-algs4 edu.princeton.cs.algs4.BinarySearch 
  </code></pre>
  
  <p>I just get errors like:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
      at edu.princeton.cs.algs4.BinarySearch.main(BinarySearch.java:94)</p>
  </blockquote>