I) Open link https://github.com/kevin-wayne/algs4 and download algs4-master zip.

II) Open link https://algs4.cs.princeton.edu/code/ and download algs4.jar

III)Open link https://algs4.cs.princeton.edu/code/ and download algs4-data.zip

IV)Windows 8 or 10: Control Panel → System and Security → System → Advanced system settings → Advanced → Environment Variables → CLASSPATH

V)Setting IDEA
1)unzip algs4-master.zip