在Netbeans中运行时,我的代码工作正常,没有任何错误。如果我做了一个干净的构建然后执行jar文件它崩溃没有任何可见的错误(swing应用程序)。
当我在命令行中执行jar文件时,我收到此错误:
D:\xxx>java -jar ScreenShotUploader.jar
Exception in thread "AWT-EventQueue0"java.lang.NoClassDefFoundError: com/melloware/jintellitype/JIntellitype
at screenshotuploader.HKRegistering.registerHK(HKRegistering.java:13)
at screenshotuploader.ScreenShotUploaderJFrame$3.run(ScreenShotUploaderJ
Frame.java:69)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(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.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)
Caused by: java.lang.ClassNotFoundException: com.melloware.jintellitype.JIntellitype
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 16 more
有什么问题?
答案 0 :(得分:3)
好像你正在引用一些库。你告诉netbeans将引用的罐子输出到罐子里吗?