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,

Recommended Answers

All 3 Replies

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

Thanks for your help

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

Yes. No.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.