Netbeans에서 실행할 때 오류없이 내 코드가 정상적으로 작동합니다. 내가 깨끗한 빌드를 만들고 jar 파일을 실행하면 오류가 보이지 않고 충돌합니다 (스윙 응용 프로그램).내 코드가 Netbeans에서 정상적으로 작동하지만 항아리를 실행할 때 예외가 throw됩니다.
내가 명령 줄에서 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
문제가 무엇입니까?
Manifest 파일을 편집하여 누락 된 jar 파일을 찾고 사용할 수 있습니다. –
감사합니다. 링크와 함께 제공되는 Baz 솔루션이 도움이되었습니다. –