File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes exception error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "exception error" Watch "exception error" New topic

exception error

chelle agno

Joined: May 07, 2003
Posts: 1
i was compiling my project and it did compile but when i', excute it says exceptionerror thread in main what this really mean? thanks
rom chatterjee
Ranch Hand

Joined: Dec 11, 2001
Posts: 46
Please post the whole error message

Rom Chatterjee<BR>Sun Certified Java Programmer
Dorothy Finkel-Laverty
Ranch Hand

Joined: Nov 24, 2001
Posts: 51
I'd bet it says "Exception in thread main java.lang.NoSuchMethodError: main". What it means is that your program did not have a main method with the proper signature - like "public static void main(String [ ] args)".
You want to learn to read these exceptions - they really point you to the solution. For example, when you run a console application, it MUST have a main method. That is the starting point for execution. If it does not have a main method that matches the signature (is named main and takes an array of Strings as the input argument), and even does not return nothing (void), it won't know where to start. The next part, "java.lang.NoSuchMethodError" tells you that the problem is in the java.lang package, and it couldn't find the method main (see it after the colon?).
Hope this helps.
I agree. Here's the link:
subject: exception error
It's not a secret anymore!