Are you really calling your classes things like "aa"? If you compiled it with Java6 make sure to run it with Java6. The classpath has nothing to do with finding the java executable file; you need to alter your PATH to change between Java6 and J2SE1.4. The -classpath option is designed for including distant files (usually .jar files) and probably won't help you here. You can alter the path temporarily, provided you can remember where you installed J2SE1.4 and Java6; you can find out how to do it on this old thread (Windows), or this old thread (Linux).
Do you have a package declaration in your class? That might make your .class files more difficult to find. If you have package declarations, then tell us.
I presume (from what you say) that the file was compiled successfully.
Try the dir (Windows) or ls (Linux) instruction to find out whether the aa.class file is in your present folder. The usual cause of a NoClassDefFoundError is that your command prompt or terminal window is not "pointing at" the correct location of the file. You will have to use the cd instruction to navigate to the correct folder. That is obviously where you saved the .java file and (if there isn't a package declaration) where the class file will be.
Joined: Oct 19, 2005
Thanks for the reply!
Yes the file is compiled(apparently) since I dont get any errors. But there is no class file in that location(or anywhere else)