If we want to set the class path permanently then we should set the class path as environment variable in Windows.The classpath value set in command prompt is temporary and is not available if we open a new command prompt.If we want to include the current directory in the search path, we must include '.' (dot or period character) in the list of paths. Setting the CLASSPATH variable or using the -classpath command-line option overrides that default. The default class path is the current directory.The class path is the path that the Java runtime environment searches for dependencies e.g.
Learn to use the -classpath or -cp option in command prompt to set classpath from command prompt in Windows and Linux OS.