[SOLVED]"Could not find the main class" for Linux Command Line Compile
I am compiling and executing a test JAVA app on my Ubuntu from command line. I have succeeded in compilation using "javac my_source_file.java" (I have set the CLASSPATH correctly so that it found the correct .jar file I am using). However, when I try to execute it by "java my_source_file", it complains about "Exception in thread "main" java.lang.NoClassDefFoundError: index" and "Could not find the main class: index. Program will exit."
However, when I run it in Eclipse, it was working just fine. I googled and somebody said it is because Eclipse will recognize the main class in the project (or you can set it there). But how can I set it in command line compilation and execution?
Thanks for any help!