Try this :
if you have this code :
package toppackage;
import......
public class ClassA {
...
public static void main(String[] args)
}
compile it, and run it (via command line) with java toppackage.ClassA
Don't forget to put the "toppackage" folder under yout classpath.
So, the steps :
1. create a folder which has same name with your package
("toppackage") in your classpath
2. write your codes at "toppackage" folder
3. compile your codes
4. run it