• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Could not execute a jar file even with proper classpath.

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to execute a jar file which looks for a driver in another jar file.

Though I had the path in the classpath, you need to mention the class-path for the jar specifially. So, I have these lines in the manifest file,


But still, the jar file is not searched in the lib folder.
I get the following error -
java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver


By the way I am trying to use hibernate pojo generator project for which I am doing this.

Let me know if anyone has any solutions for the same.
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Presumably, then, that "lib" folder is not in the same folder as the jar? Your file structure should look something like this:

-- somefolder
-- -- your.jar
-- -- lib
-- -- -- db2jcc4.jar
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And not like this, with the JAR file inside the other JAR file:
-- somefolder
-- -- your.jar
-- -- -- lib
-- -- -- -- db2jcc4.jar
reply
    Bookmark Topic Watch Topic
  • New Topic