I'm trying to setup the programming environment for Princeton's online course at this website: http://algs4.cs.princeton.edu/code/ However, when I try and run one of the programs I get the following error:

/Users/dane/algs4/algs4-2/RandomSeq.java:45: cannot find symbol
symbol  : variable StdRandom
location: class RandomSeq
                double x = StdRandom.uniform();
                           ^
/Users/dane/algs4/algs4-2/RandomSeq.java:46: cannot find symbol
symbol  : variable StdOut
location: class RandomSeq
                StdOut.println(x);
                ^
/Users/dane/algs4/algs4-2/RandomSeq.java:56: cannot find symbol
symbol  : variable StdRandom
location: class RandomSeq
                double x = StdRandom.uniform(lo, hi);
                           ^
/Users/dane/algs4/algs4-2/RandomSeq.java:57: cannot find symbol
symbol  : variable StdOut
location: class RandomSeq
                StdOut.printf("%.2f\n", x);
                ^
4 errors

The classes that generate the errors are from libraries downloaded from the website. They have been added to the classpath, which can be seen in the attached photo. Any help would be greatly appreciated. I'm trying to set up the programming environment on a Mac.

do you have a class called StdRandom which contains a static method called 'uniform' and takes no parameters?
the same for the other 'errors'. either the class doesn't exist, or it's in a different package and you haven't imported it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.