File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes NoSuchMethodError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "NoSuchMethodError" Watch "NoSuchMethodError" New topic
Author

NoSuchMethodError

aruna dabas
Greenhorn

Joined: Dec 16, 2008
Posts: 27

Dear friends please let me know why i am getting runtime error.
Thank you
abin awale
Greenhorn

Joined: Dec 23, 2008
Posts: 7
I copied and pasted your code and its working perfectly fine in my eclipse.

Please check the file name of your code. Is it Test.java?
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
Abin is correct. The java command needs the name of the class where your main() is defined. Notice that you don't need to change the name of your source file, however. Just invoke
java Test
at the command line, in the directory where Test.class is located.


All code in my posts, unless a source is explicitly mentioned, is my own.
aruna dabas
Greenhorn

Joined: Dec 16, 2008
Posts: 27
abin now it is working with file name Test.java.but as Files with no public classes can have a name that does not match any of the class in this file.please let me know.Thanking You
aruna dabas
Greenhorn

Joined: Dec 16, 2008
Posts: 27
Thank You Roben.
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
No problem, Aruna. I realized that might be the confusing part, since your source file doesn't have any public classes. The java command still needs the name of the class with the main method on it though.
aruna dabas
Greenhorn

Joined: Dec 16, 2008
Posts: 27
Thanks Ruben for clarifying my doubt.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoSuchMethodError