Hello, I have a code which has public void run() and I have no problems compile the code. When I try to execute the class file I get an error Exception in thread "main" java.lang.NoSuchMethodError: main.

Does the command line execution needs main() ? Is there a way to execute without the main() from the command prompt. Please share your thoughts,

read and understand the Java tutorial and all will become clear (or at least clearer than it is now) to you.

Does the command line execution needs main() ? Is there a way to execute without the main() from the command prompt.

Yes. No.