in a strange manner the JVM is unable to recognize a class file when is give
but before you can ask me to check whether the source code and class name matches ofcourse it does and more over i am able to run the file using an IDE.
But when i use command prompt to compile and run i am able to compile but i am unable to run the class file and the error i am receiving is as if there is no such class.
i even tried checking the bin directory what my IDE gentrates for the src(source) directory which is working properly in the IDE is unable to run with command prompt.
saipraneeth nallapareddy wrote:thank you, it did worked.
but can you explain me why it needs to be done because i am already in the same location right.
The classpath is used by the JVM to find the classes that it needs -- and since the class file is not in the jar file that you specified in the class path, you get an error condition.
In the case of the java compiler, it actually doesn't need the Seek class file. It is generating it.
As for being in the "same location" rule, that only applies when you don't set the class path -- the default class path. In your example, you set it, hence, there is no need to search the default class path.
Joined: Dec 02, 2009
thanks for the explanation it did really gave a useful point for me & where i can make a crystal clear about this point from my existing knowledge regarding this.