If I were you I would use the command line switches to affect the class path.Thus, if you want to compile .java files in the C:\Java directory, first switchto that directory and then type:java -classpath . *.java