title: In Coursera Algorithms I course, "error: package edu.princeton.cs.algs4 does not exist"
body: <p>I'm trying to complete the first assignment of the Coursera course <a href="https://www.coursera.org/learn/introduction-to-algorithms" rel="nofollow noreferrer">Algorithms I</a>. As I'm using Linux, I followed the instructions on <a href="http://algs4.cs.princeton.edu/linux/" rel="nofollow noreferrer">http://algs4.cs.princeton.edu/linux/</a> and created a <code>~/algs4</code> directory. The test programs seem to work; for example, the command</p>
  
  <pre><code>kurt@kurt-ThinkPad:~$ java-algs4 edu.princeton.cs.algs4.StdDraw
  </code></pre>
  
  <p>generates the image below.</p>
  
  <p><a href="https://i.stack.imgur.com/6qUUR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6qUUR.png" alt="enter image description here"></a></p>
  
  <p>Next, I'm trying to run a test program in a subdirectory of <code>~/algs4</code>:</p>
  
  <pre><code>import edu.princeton.cs.algs4.In;
  import edu.princeton.cs.algs4.StdDraw;
  
  public class PercolationTest {
    public static void main(String[] args) {
      System.out.println("Hello, world!");
    }
  }
  </code></pre>
  
  <p>However, if I try to compile this I get the following errors:</p>
  
  <pre><code>kurt@kurt-ThinkPad:~/algs4/PercolationTest$ javac PercolationTest.java
  PercolationTest.java:3: error: package edu.princeton.cs.algs4 does not exist
  import edu.princeton.cs.algs4.In;
                               ^
  PercolationTest.java:4: error: package edu.princeton.cs.algs4 does not exist
  import edu.princeton.cs.algs4.StdDraw;
                               ^
  2 errors
  </code></pre>
  
  <p>This way of importing does seem consistent with what is explained on <a href="http://algs4.cs.princeton.edu/code/" rel="nofollow noreferrer">http://algs4.cs.princeton.edu/code/</a>, so I'm having trouble seeing what I did wrong. Any ideas?</p>