wood burning stoves 2.0*
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: 18141
    
    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: 19544
    
  16

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Could not execute a jar file even with proper classpath.
 
Similar Threads
help to includes jar files in classpath of a jar file
Building a jar with dependancies.
NoClassDefFoundError running a jar file from the command line
RunJavaApplication As Executable Jar
Running jar from anywhere