Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoSuchMethod error ?

 
Dean Bright
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this code runs fine on my machine.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please => UseCodeTags <=, Use the EDIT button to edit it and put the code tags! It'll be more readable!
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are no problems, works fine!
 
Dean Bright
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic