0

I have written a java program which uses ojdbc14.jar and the program is working fine until it is in eclipse.when I create an executable jar file the ojdbc14.jar is not getting packaged along with it hence my program is not having the driver to make the required connection with the DB.can someone help me in coming up with the steps to create an executable jar file along with the required drivers.

PS: I am doing all this in eclipse so steps relating to eclipse would be highly appreciated.

Prashanth K
  • 121
  • 2
  • 3
  • 10
  • Do you use maven, or gradle, for instance? – fge Jun 05 '13 at 23:01
  • No..not using maven,gradle...my program is a simple one...just a making a connection to DB and execute some queries automatically.. – Prashanth K Jun 05 '13 at 23:05
  • 1
    This question gets asked almost every day on this site... Please do some searching. Here's [what I found](http://stackoverflow.com/q/502960/778118) by googling "_eclipse include jars in jar_" and clicking on the first result from this site. – jahroy Jun 05 '13 at 23:13

1 Answers1

2

If you Export a Runnable Jar File, the dependencies will be packaged within the file.

See: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-37.htm

Also, you can select how the dependencies will be included/packaged:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-export-runnable-jar.htm&anchor=library-handling

Menelaos
  • 23,508
  • 18
  • 90
  • 155