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 NoSuchMethod error ? 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 "NoSuchMethod error ?" Watch "NoSuchMethod error ?" New topic
Author

NoSuchMethod error ?

Dean Bright
Greenhorn

Joined: Jul 19, 2010
Posts: 3
Im a little confused as to why I am getting the following error at runtime :

Exception in thread "main" java.lang.NoSuchMethodError: Dog.<init>(Ljava/lang/String;)V
at IteratorTest.main(IteratorTest.java:10)


Here is the source code, saved as IteratorTest.java, it is an example from K&B pg580, I've just decided to play around with it a bit however even copying the code exactly it doesnt seem to work.

Neha Daga
Ranch Hand

Joined: Oct 30, 2009
Posts: 504
this code runs fine on my machine.


SCJP 1.6 96%
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Please => UseCodeTags <=, Use the EDIT button to edit it and put the code tags! It'll be more readable!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

There are no problems, works fine!
Dean Bright
Greenhorn

Joined: Jul 19, 2010
Posts: 3
Thanks, just tried it again myself from the command line and it works 100% .... the problem occurred whenever running it directly from my IDE, JEdit which is how I have been doing things for every other bit of code I have wrote. Thanks for the quick responses.
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Dean Bright wrote:Thanks, just tried it again myself from the command line and it works 100% .... the problem occurred whenever running it directly from my IDE, JEdit which is how I have been doing things for every other bit of code I have wrote. Thanks for the quick responses.

May be that IDE have its own compiler!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoSuchMethod error ?