I am Using Eclipse to Run my java programs. But when I try to run a Simple hello world program from Command prompt, I get the below error
"Could not find or load main class Test"
Test.class resides inside C:\
I Went inside C:\ in Cmd and typed java Test, above said error came . But when i typed java -cp . Test, it showed the output.
Why is the error coming when simply typing "java Test" . I have checked the classpath in the environment Variable under "Path" for both System as well as User defined, it has the following address C:\Program Files\Java\jdk1.7.0_21\bin\ but still error is coming.