• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

NoSuchMethod error ?  RSS feed

 
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.

 
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this code runs fine on my machine.
 
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!
 
Everybody's invited. Except this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!