It seems that the -cp option overrides the CLASSPATH environment variable.
$ export CLASSPATH=Tests $ java Printf Team Name No. of Wins No. of Losses Bobcats 0 0 Tigers 1 1 Lions 2 2 Cheetahs 3 3 Jackals 4 4 Leopards 5 5 Snow Leopards 6 6 Cougars 7 7 Mountain Lions 8 8 Bobcats 9 9 $ java -cp . Printf Error: Could not find or load main class Printf
The CLASSPATH environment variable is still set to the Tests folder, however, when I use the -cp , it overrides it and changes the class path . , the current directory, so my class file can no longer be found.
source share