Skip to main content



      Home
Home » Newcomers » Newcomers » jar execution - classnotfound
jar execution - classnotfound [message #144180] Tue, 21 March 2006 09:56 Go to next message
Eclipse UserFriend
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 #145581 is a reply to message #144180] Thu, 30 March 2006 02:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bradley_nospam.thekonkles.com

I have the same issue, but with Microsoft Drivers.
Was a solution ever found?

Thanks.

"nate" <nathan.chun@ngc.com> wrote in message
news:d3683d89f9995b5b797b5cc9424b4df7$1@www.eclipse.org...
>
> 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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Control of views/perspectives
Next Topic:special syntax on executing the classfile
Goto Forum:
  


Current Time: Sun Jun 08 01:08:57 EDT 2025

Powered by FUDForum. Page generated in 0.07974 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top