我在編譯使用嵌入式Derby數據庫的Java程序時遇到問題。我正在使用Netbeans,並使用「Clean and build」選項創建了一個dist文件夾。我加入了數據庫的DIST /資源文件夾時,我有德比連接指出:Java,用嵌入式德比數據庫編譯程序
System.setPropert("derby.system.home", System.getProperty("user.dir") + "//resources"
麻煩的是,有些人不能運行的程序。對於某些人來說,只需單擊dist文件夾中的.jar文件即可。對於其他人來說,它根本不會運行。另外,我已經給了人全包了,他們有從NetBeans中,出現以下錯誤運行它的麻煩:
-do-compile: [javac] Compiling 11 source files to /home/bull/Desktop/asdfasd/build/classes [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [copy] Copying 81 files to /home/bull/Desktop/asdfasd/build/classes [copy] Copied 4 empty directories to 1 empty directory under /home/bull/Desktop/asdfasd/build/classes
-post-compile:
compile:
run: [java] java.sql.SQLException: No suitable driver found for jdbc:derby:CS242 [java] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException [java] at customeremailmanager.CustomerDB.getCustomers(CustomerDB.java:105) [java] at customeremailmanager.CustomerEmailFrame.(CustomerEmailFrame.java:26) [java] at customeremailmanager.CustomerEmailFrame$11.run(CustomerEmailFrame.java:450) [java] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) [java] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721) [java] at java.awt.EventQueue.access$200(EventQueue.java:103) [java] at java.awt.EventQueue$3.run(EventQueue.java:682) [java] at java.awt.EventQueue$3.run(EventQueue.java:680) [java] at java.security.AccessController.doPrivileged(Native Method) [java] at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:691) [java] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) [java] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
所以,什麼纔是我是做錯了這個計劃?以下是整個軟件包:http://wikisend.com/download/969374/CustomerEmailManagerGUI.zip