you should include all jar files in the classpath.
CLASSPATH=.
for j in ~/Java/algs4/bin/*.jar; do CLASSPATH=$CLASSPATH:$j done
export CLASSPATH
CLASSPATH environment is ':' separated entries, both jar/zip file and directory.
directory is used to search .class files, not jar file