J
Jonathan
Hello folks.
I realize that problems with classpaths are a pretty common theme here,
but I've been wrestling with this for days. I've been searching
newsgroups and websites but I can't find an answer to my problem.
I am trying to include the mysql JDBC driver with my application's JAR
file. I've only succeeded to run the application with the driver by
running the main class.
I have tried to include the Class-Path with the JAR's manifest, like
so:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.4.2_06-b03 (Sun Microsystems Inc.)
Main-Class: Scheduler
Class-Path: C:\physioclinic\mysql-connector-java-3.0.15-ga-bin.jar
However, when I include the Class-Path attribute, the JAR can no longer
find the Scheduler main class.
I've experimented with including the build and dist directories in the
Class-Path, but it will not find the main class when the Class-Path
attribute is included.
The only time it works is when I remove the Class-Path attribute. So
I've tried including the jar for the driver on the command-line
instead, running with
java -classpath C:\physioclinic\mysql-connector-java-3.0.15-ga-bin.jar
-jar dist\scheduler.jar
Which runs, but cannot find the driver. It does find the driver when I
do the same thing without the JAR file.
Can anyone shed some light on this? Should I post my build file from
ANT?
I usually find my answers scouting the newsgroups but this time I can't
seem to get anywhere. Thanks in advance.
I realize that problems with classpaths are a pretty common theme here,
but I've been wrestling with this for days. I've been searching
newsgroups and websites but I can't find an answer to my problem.
I am trying to include the mysql JDBC driver with my application's JAR
file. I've only succeeded to run the application with the driver by
running the main class.
I have tried to include the Class-Path with the JAR's manifest, like
so:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.4.2_06-b03 (Sun Microsystems Inc.)
Main-Class: Scheduler
Class-Path: C:\physioclinic\mysql-connector-java-3.0.15-ga-bin.jar
However, when I include the Class-Path attribute, the JAR can no longer
find the Scheduler main class.
I've experimented with including the build and dist directories in the
Class-Path, but it will not find the main class when the Class-Path
attribute is included.
The only time it works is when I remove the Class-Path attribute. So
I've tried including the jar for the driver on the command-line
instead, running with
java -classpath C:\physioclinic\mysql-connector-java-3.0.15-ga-bin.jar
-jar dist\scheduler.jar
Which runs, but cannot find the driver. It does find the driver when I
do the same thing without the JAR file.
Can anyone shed some light on this? Should I post my build file from
ANT?
I usually find my answers scouting the newsgroups but this time I can't
seem to get anywhere. Thanks in advance.