Jar cannot find driver
Hello,
How can I include and preserve classpaths in jars? My application access an MS SQL server and it works fine as long is invoked from the command prompt. When I jar it however, I am getting:
java.land.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
I know it is the JDBC driver that cannot be found, but how to I make the jar application see it?
This is how I run my app from cmd and it works fine:
java -cp "C:\Program Files\Java\jre1.5.0_08\lib\ext\sqljdbc.jar;C:\Program Files\Java\FolderContainingClass" AppName
This is my manifest:
Manifest-Version: 1.2
Main-Class: Kb
Classpath: .\AppName.jar
This is how I create my jar:
jar cvfm AppName.jar AppNameManifest *
The sqljdbc.jar driver is in the same directory with the class and manifest files.
Any hint is appreciated,
Regards

