我已经为我的项目创建了一个可运行的 jar,当我尝试执行它时出现异常,但从 eclipse 中它执行得很好
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)
我在哪里发现setControlKeepAliveTimeout
是项目中包含的 Jar 之一的方法。我还没有解决这个问题。
最佳答案
您的操作系统环境中的 com.FTP 库版本与 Eclipse 环境中的版本不同。确保类路径在两个环境中引用相同的 JAR。
关于java - 线程 "AWT-EventQueue-0"java.lang.NoSuchMethodError : setControlKeepAliveTimeout(J)V 中出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20988433/