Error: Could not find or load main class(Java)


I am using java in ubuntu machine. I can run java program from my eclipse. But I have some work that that I have to perform from command prompt. I could compile java program using javac command and its create the HelloWorld.class in same directory. But when I run java HelloWorld command its gives me following error.

Error: Could not find or load main class

I dont know why???

can anyone tell me what's the problem?

Best Answer

Check you CLASSPATH. It should contain current directory (aka ".").

Related Question