組み込み Derby データベースを使用する Java プログラムのコンパイルに問題があります。私はNetbeansを使用しており、distフォルダーを作成する「クリーンアンドビルド」オプションを使用しました。データベースを dist/resources フォルダーに追加しました。これは、ダービー接続が指しているフォルダーです。
System.setPropert("derby.system.home", System.getProperty("user.dir") + "//resources"
問題は、プログラムを実行できない人がいるということです。一部の人にとっては、dist フォルダー内の .jar ファイルをクリックするのと同じくらい簡単です。他の人にとっては、まったく実行されません。また、パッケージ全体を人々に提供しましたが、次のエラーで Netbeans から実行するのに問題があります。
-do-compile: [javac] 11 個のソース ファイルを /home/bull/Desktop/asdfasd/build/classes にコンパイル中 [javac] 注: 一部の入力ファイルでは、未チェックまたは安全でない操作が使用されています。[javac] 注: 詳細については、-Xlint:unchecked で再コンパイルしてください。[コピー] 81 個のファイルを /home/bull/Desktop/asdfasd/build/classes にコピー [コピー] 4 つの空のディレクトリを /home/bull/Desktop/asdfasd/build/classes の下の 1 つの空のディレクトリにコピー
-ポストコンパイル:
コンパイル:
実行: [java] java.sql.SQLException: jdbc:derby:CS242 に適したドライバーが見つかりません [java] スレッド "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] で java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) [java] で java.awt.EventQueue.dispatchEvent(EventQueue.java:691) [java] でjava.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) [java] java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) で [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) で [java] java.awt.EventDispatchThread.run(EventDispatchThread.ジャワ:97)doPrivileged(Native Method) [java] at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) [java] java.awt.EventQueue.dispatchEvent(EventQueue.java:691) [java] java.awt. EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) [java] で java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] で java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] でjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) で [java] java.awt.EventDispatchThread.run(EventDispatchThread.java:97) でdoPrivileged(Native Method) [java] at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) [java] java.awt.EventQueue.dispatchEvent(EventQueue.java:691) [java] java.awt. EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) [java] で java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] で java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] でjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) で [java] java.awt.EventDispatchThread.run(EventDispatchThread.java:97) でdoIntersectionPrivilege(ProtectionDomain.java:76) [java] java.awt.EventQueue.dispatchEvent(EventQueue.java:691) [java] java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) [java] で。 awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) [java] で] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) で [Java] java.awt.EventDispatchThread.run(EventDispatchThread.java:97) でdoIntersectionPrivilege(ProtectionDomain.java:76) [java] java.awt.EventQueue.dispatchEvent(EventQueue.java:691) [java] java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) [java] で。 awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) [java] で] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) で [Java] java.awt.EventDispatchThread.run(EventDispatchThread.java:97) でpumpOneEventForFilters(EventDispatchThread.java:244) [java] java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] で。 awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) で [java] java.awt.EventDispatchThread.run(EventDispatchThread.java:97) でpumpOneEventForFilters(EventDispatchThread.java:244) [java] java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) [java] java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) [java] で。 awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) [java] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) で [java] java.awt.EventDispatchThread.run(EventDispatchThread.java:97) で147) [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)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