It's not a secret anymore!*
The moose likes Beginning Java and the fly likes Executable jar and the classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Executable jar and the classpath" Watch "Executable jar and the classpath" New topic

Executable jar and the classpath

Steve Gibson
Ranch Hand

Joined: Jan 17, 2006
Posts: 37
I wrote a java app that uses the MS sqlServer jdbc driver. The driver location is in the system classpath (XPpro sp2) and when I execute my app as:

all is good......

So I created a executable jar file and cannot get the sqlServer driver to load.

I created this manifest file:

and created the jar with:

I have tried all kinds of variations of the jar creation and the manifest file, but cannot get the sqlServer driver to load. All I get is:

I have spent the day searching the net for an answer and haven;t come up with anything yet.

HELP!!! what am i doing wrong???
[ March 17, 2006: Message edited by: Steve Gibson ]

An insane man is perfectly sane in his own mind - cira 1984 a very young chemically altered S.Gibson<br /> <br />Yes we do build our software idiot proof, problem is they keep building better idiots. - (used by S.Gibson to break the tension during a confernece call with the CIO)
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130

A couple of points:

The path delimiter in your Class-Path attribute in your manifest file should be space - not a ";". Secondly, the path to the sqljdbc.jar file has to be expressed as a relative path and not an absolute path.

Try this for your Class-Path attribute in the manifest file:

Class-Path: . \MSJDBCDriver\sqljdbc_1_0\enu\sqljdbc.jar

Let us know how you go and good luck,
Steve Gibson
Ranch Hand

Joined: Jan 17, 2006
Posts: 37
It Worked..... Thanks
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Executable jar and the classpath
Similar Threads
Executable JAR help!
Executable Jar using the System Classpath
Need tips if possible
executable jar file
Jar file exception due to not finding Oracle driver but other standalone programs can use it