Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NoSuchMethodError, even though method is clearly there

807606May 8 2007 — edited May 8 2007
Hi all,

I'm writing a program using Eclipse. The program uses a third-party jar, which I have added to the project's build path.

In Eclipse, if you write out an object's name and then hit the period (.), you get a list of all the methods. Using this, I scroll down to the method "getName()", which takes no arguments.

To be sure, I also open the jar in Eclipse, open the Java class that the object belongs to, and note that the method "getName()" exists (even though I can't see the source itself, naturally).

Eclipse accepts the line with no errors.

However, when I run the program from Eclipse, I get the error
  Exception in thread "Thread-2" java.lang.NoSuchMethodError:
  edu.colorado.phet.common.application.PhetApplication.getName()Ljava/lang/String;
	at org.concord.otrunkphet.sound.OTPhetSoundModelView$startWaveInterferenceApplication.run(OTPhetSoundModelView.java:72)
	at java.lang.Thread.run(Thread.java:613) 
How can I get a NoSuchMethodError when both Eclipse and I see the method in the jar?

Any help much appreciated,
Sam
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2007
Added on May 8 2007
2 comments
1,189 views