Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to include Oracle JDBC driver in client jar file using Jdeveloper 11g release 1(11.1.1.4.0)

to442951anJan 24 2015 — edited Jan 24 2015

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?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 21 2015
Added on Jan 24 2015
3 comments
1,646 views