A
adam.balgach
Greetings all,
As mentioned in the subject, I am coding on an OS X and using Eclipse
as my IDE. I can create the executable JAR just fine through eclipse,
but when I try and run the JAR from the command line I am getting weird
ClassNotFoundExceptions() however, I am almost 100% sure everything is
set correctly. An external JAR [for mysql DB access] seems to be the
problem...here is the output:
[ab4 ~]$ echo $CLASSPATH
/opt/MySystem/mysql-connector-java-3.1.13-bin.jar
[ab4 /opt/MySystem]$ java -jar System-1_0.jar
[ 10-28-2006 08:39:34 mySystem.SysMain ] WARNING: System Is Starting
up...
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: checkForDB():
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: No Database
Detected!...
clearly it can not find the mysql jar [although this runs perfectly
fine, inside of eclipse]
so i tried explicitly stating the mysql jar in the java command line:
[ab4 /opt/MySystem]$ java -classpath
/opt/MySystem/mysql-connector-java-3.1.13-bin.jar -jar System-1_0.jar
[ 10-28-2006 08:39:34 mySystem.SysMain ] WARNING: System Is Starting
up...
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: checkForDB():
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: No Database
Detected!...
even when i put the external JAR with the -classpath option it seems to
not be able to find it.
any thoughts on to what I am doing wrong? It seems like its something
minor and/or related to Macs [Tiger 10.4.8] using JDK:
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)
Thanks for all your help.
Cheers,
Adam.
As mentioned in the subject, I am coding on an OS X and using Eclipse
as my IDE. I can create the executable JAR just fine through eclipse,
but when I try and run the JAR from the command line I am getting weird
ClassNotFoundExceptions() however, I am almost 100% sure everything is
set correctly. An external JAR [for mysql DB access] seems to be the
problem...here is the output:
[ab4 ~]$ echo $CLASSPATH
/opt/MySystem/mysql-connector-java-3.1.13-bin.jar
[ab4 /opt/MySystem]$ java -jar System-1_0.jar
[ 10-28-2006 08:39:34 mySystem.SysMain ] WARNING: System Is Starting
up...
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: checkForDB():
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: No Database
Detected!...
clearly it can not find the mysql jar [although this runs perfectly
fine, inside of eclipse]
so i tried explicitly stating the mysql jar in the java command line:
[ab4 /opt/MySystem]$ java -classpath
/opt/MySystem/mysql-connector-java-3.1.13-bin.jar -jar System-1_0.jar
[ 10-28-2006 08:39:34 mySystem.SysMain ] WARNING: System Is Starting
up...
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: checkForDB():
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[ 10-28-2006 08:39:34 mySystem.SysMain ] ERROR: No Database
Detected!...
even when i put the external JAR with the -classpath option it seems to
not be able to find it.
any thoughts on to what I am doing wrong? It seems like its something
minor and/or related to Macs [Tiger 10.4.8] using JDK:
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)
Thanks for all your help.
Cheers,
Adam.