Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Could not execute a jar file even with proper classpath. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Could not execute a jar file even with proper classpath." Watch "Could not execute a jar file even with proper classpath." New topic
Author

Could not execute a jar file even with proper classpath.

cheenu Dev
Ranch Hand

Joined: Nov 13, 2005
Posts: 276
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.


cheenujunk@gmail.com
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: Oct 27, 2005
Posts: 19696
    
  20

And not like this, with the JAR file inside the other JAR file:
-- somefolder
-- -- your.jar
-- -- -- lib
-- -- -- -- db2jcc4.jar


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Could not execute a jar file even with proper classpath.