0

I have created a runnable jar for my project and when I try to execute it I am getting exception, but from eclipse it is executing fine

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: com.FTP.setControlKeepAliveTimeout(J)V
    at com.FTP.<init>(FTP.java:64)
    at com.build.Build.GetFtp(Build.java:71)
    at com.build.MainFile.step1(MainFile.java:79)
    at com.build.ui.ScreenL.jButton2MouseClicked(ScreenL.java:240)
    at com.build.ui.ScreenL.access$1(ScreenL.java:215)
    at cm21.build.ui.ScreenL$2.mouseClicked(ScreenL.java:88)
    at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

where i find out that setControlKeepAliveTimeout is a method from one of the Jar's included in the project. am not still resolve this issue.

gowtham
  • 977
  • 7
  • 15
user2572003
  • 743
  • 3
  • 8
  • 16
  • See [this link](http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-%28Java%29), You may not have added the jar to your project build path – Paul Samsotha Jan 08 '14 at 06:32
  • @peeskillet that would cause [NoClassDefFoundError](http://docs.oracle.com/javase/7/docs/api/java/lang/NoClassDefFoundError.html), while we have NoSuchMethodError. – Basilevs Jan 08 '14 at 09:08
  • possible duplicate of [How do I fix a NoSuchMethodError?](http://stackoverflow.com/questions/35186/how-do-i-fix-a-nosuchmethoderror) – Basilevs Jan 08 '14 at 10:12
  • @peeskillet Thanks i included the jar files in the project. that really helped me. – user2572003 Jan 09 '14 at 05:22

1 Answers1

1

Your com.FTP library version in your OS environment differs from the one in the Eclipse environment. Make sure classpath references same JAR on both environments.

Basilevs
  • 22,440
  • 15
  • 57
  • 102