File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes excutable jar & manifest question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "excutable jar & manifest question" Watch "excutable jar & manifest question" New topic
Author

excutable jar & manifest question

Harry Steinke
Greenhorn

Joined: Dec 09, 2005
Posts: 13
I have an app that runs fine in WSAD (WebSphere) or when I call the main class file in DOS. The jar creates fine but I get a runtime exception "unable to load DB2 driver" when it runs. All the db2 class files are contained in a zip file.
I have seen many examples showing how to place Class-Path: in the manifest but they all seem to show references to another jar file. Is is possible to refer to other class files in a zip file? Would the class path reference the location of the zip file or a location in the project?
Any help would be appreciated.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

It wouldn't take you long to find out, by renaming X.zip (that file containing the DB2 drivers) to X.jar. And setting up the manifest to point to X.jar.
Harry Steinke
Greenhorn

Joined: Dec 09, 2005
Posts: 13
Hadn't thought of that. I'll give it a try.
Harry Steinke
Greenhorn

Joined: Dec 09, 2005
Posts: 13
Still can't get the jar to load the db2 driver.
Any other thoughts?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

Not thoughts, but guesses.

1. Your manifest doesn't have a Class-Path entry.

2. It doesn't have a line-ending (CR/LF) at the end of the entry it does have.

3. The entry doesn't have the right name for the jar file.

4. It doesn't have the right relative path to the jar file.

5. You used backslashes instead of slashes in the relative path.

6. You forgot to rename the zip file to have the .jar extension.

7. The jar file doesn't contain the DB2 driver.

8. The jar file doesn't contain the classes for DB2 licencing.

I'm sure there's more possibilities...
Harry Steinke
Greenhorn

Joined: Dec 09, 2005
Posts: 13
Thanks for the help.
It turns out that I didn't have the jar file in a subdirectory of the app. Once I did that it worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: excutable jar & manifest question