• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the reason of this exception  RSS feed

 
Anchit Jindal
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run a certain code it gives the following exception. Surprisingly the same code works fine on other machine. What can be the cause of this?? Please help. Thanks a lot...............

Exception in thread "main" java.lang.NoSuchMethodError: calculateSecurityWarning
Position
at java.awt.Window.initIDs(Native Method)
at java.awt.Window.<clinit>(Unknown Source)
at Gui.<init>(Gui.java:14)
at Gui.main(Gui.java:10)
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you running this appilcation in any IDE?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be that the class having the calculateSecurityWarning is old (a version of the class which does not have that method), or there's another class with the same name and same package somewhere else in your classpath.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That error means that your classes are out of sync: you are running the program probably with a different version of some library than what your program was compiled with.

Suppose you have SomeLibrary version 1.2 that you use for compiling your program. SomeClass in that library contains a method named calculateSecurityWarning. Now, on another computer, suppose that you have SomeLibrary version 1.0 installed, in which SomeClass does not contain the method calculateSecurityWarning. If you try to run your program on that computer, you will get a NoSuchMethodError.

Check if the libraries on the other computer are the right versions that your application needs.
 
Anchit Jindal
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>That error means that your classes are out of sync: you are running the program probably with a different version of some library than what your program was compiled with.

No dear I am compiling and running the program with same version.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!