Please refer the link
http://docs.oracle.com/javase/6/docs/technotes/tools/findingclasses.html. the given link says
By default, javac and javadoc search the user class path for both class files and source code files. If the -sourcepath option is specified, javac and javadoc search for source files only on the specified source file path, while still searching the user class path for class files.
to
test this, i created source code file as below:
i put the above file in c:\users\g\world directory. then i set the classpath as set classpath=c:\users\g\world. then i ran javac from the d: root drive as d:\> javac HelloWorld.java. according to above link javac by default searches user classpath for source file and class file so it should have compiled . what is the reason ?