I have a simple standalone java application which is required to connect to Oracle db. The application can be successfully run under JDeveloper IDE. Then I make use of the deployment facility in Jdeveloper to create a deployment Jar file. However, the program runs failure with the following error:
E:\KaMing\Office\Project\IPKMS\JavaApp\IPKMSProject\deploy>g:\java\jre1.6.0_24\bin\java -jar IPKMS810.jar
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver at hkpost.ipkms.datasyn.database.Database.createConnection(Database.java:86)
at hkpost.ipkms.datasyn.syn.IPKMS810.getConnection(IPKMS810.java:485)
at hkpost.ipkms.datasyn.syn.IPKMS810.createConnection(IPKMS810.java:299)
at hkpost.ipkms.datasyn.syn.IPKMS810.main(IPKMS810.java:104)
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
After studied the output jar file generated by Jdeveloper, I have found that there is no Oracle JDBC stored in the Jar file. How can I include such library in my output jar file?