jar execution - classnotfound [message #144180] |
Tue, 21 March 2006 09:56  |
Eclipse User |
|
|
|
Originally posted by: nathan.chun.ngc.com
I have created a simple JDBC app that inserts data into the Oracle10g db.
It runs fine in eclipse.
When I try to create a jar file using eclipse export, executing the jar
gives ClasNotFoundException on oracle.jdbc.driver.OracleDriver.
I'v tried using -cp/classpath on the command line of the jar execution,
same error. (My jar file does not contain the oracle ojdbc14.jar.)
Is adding the oracle odjbc14.jar file to my jar an option.
If so, how do I add the ojdbc14.jar file?
(The Eclispe -export-jar option does present the ojdbc14.jar file as a
resource to add to my jar.)
thanks
|
|
|
|
Re: jar execution - classnotfound [message #145731 is a reply to message #144180] |
Thu, 30 March 2006 13:22  |
Eclipse User |
|
|
|
Originally posted by: eclipse3.rizzoweb.com
nate wrote:
>
> I have created a simple JDBC app that inserts data into the Oracle10g
> db. It runs fine in eclipse.
>
> When I try to create a jar file using eclipse export, executing the jar
> gives ClasNotFoundException on oracle.jdbc.driver.OracleDriver.
>
> I'v tried using -cp/classpath on the command line of the jar execution,
> same error. (My jar file does not contain the oracle ojdbc14.jar.)
>
> Is adding the oracle odjbc14.jar file to my jar an option.
> If so, how do I add the ojdbc14.jar file? (The Eclispe -export-jar
> option does present the ojdbc14.jar file as a resource to add to my jar.)
This is not really an Eclipse question, but...
A JAR file can not contain other JARs in any useful way. You can embed
the Oracle JAR into your own JAR, but your classes can not reference it.
When running your application outside of Eclipse you'll need to set the
classpath to include the Oracle JAR - see numerous resources on the web
for the various ways to do that.
Hope this helps,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.07974 seconds