• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could not execute a jar file even with proper classpath.

 
cheenu Dev
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Clapham
Sheriff
Pie
Posts: 20980
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And not like this, with the JAR file inside the other JAR file:
-- somefolder
-- -- your.jar
-- -- -- lib
-- -- -- -- db2jcc4.jar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic