Q:

Error: Could not find or load main class on running the java file

When I compile the following, it compiles and creates a .class file. It works
javac -classpath abc.jar Abc.java

But when I run the following:
java -classpath abc.jar Abc

It gives this error:
Error: Could not find or load main class

I am using a cmd on windows 7. It works with a basic helloworld example but not with others.

A:

it overrides classpath so again you will have to add current directory to classpath
java -classpath abc.jar:. Abc

