This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
The classpath tells Java where to find Java class files. It does not tell Java where to find source files.
I'm not very familiar with the sourcepath option, but my understanding is that it's for specifying the location of .java source files that your main source file is dependent on -- not the location of the main file itself.
Does that make sense?
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
Joined: Mar 07, 2008
yes...its kinda makes sense. So what would one do if the main source file is in a different directory?
I understand that it is easy to go to the source file directory in my case. But then there could be circumstances where one might want to compile source files in a different directory.
I have been having exactly that problem, last night I started picking up builds even on files that were on a different root. That was because I had used settings/control panel/system/advanced/environment variables to set a long string containing every dir I could think of and then later was trying to work on a temporary version without disturbing the main build.
See: @argfiles which is likely more useful. This allows fast access to a configuration file that is stored with the sources.