Henry Wong wrote:
Steve De Costa wrote:Why the hell would it be looking somewhere else in the first place.
That is how it supposed to work. If you set a class path, either via environment variable or command line, it will use that for the roots of the classes. And if the current directory isn't in the class path, then it won't search your current directory.
Anyway, care to tell us... (1) if you have a CLASSPATH environ set? (2) how you are compiling (3) you directory structure and (4) where the java and class files are located, and maybe we can see something.
Henry
Henry Wong wrote:
This actually confirms that the new compiled code isn't the code that is running -- and that you are running some old class files somewhere.
Anyway, I recommend that you traverse all the directories in your classpath, to see if you can find the old code. You also need to add the location that you are using to compile with in your class path too, as it doesn't seem to be able to find your new stuff, when you renamed it.
Henry
Bear Bibeault wrote:Nope, the compiler doesn't keep anything in its "memory". Somehow you are either not compiling and running the file that you think you are, or your class file is not being updated with the new code like you think it is.
Garrett Rowe wrote:The short answer is that it is possible to do what you want using reflection (google java reflection).
The longer answer is this is almost always the wrong way to go about doing anything. Exactly what problem are you trying to solve here? Maybe we can help you find a more idiomatic way.