external jar question

hi all,

I made a Java application in Eclipse;

in Project - Properties - Build Path - Libraries, I added an external jar to be able to connect to a mysql database.

Now I can execute this application perfectly from Eclipse and on the same machine.

But now I need to put this application on another machine, but when I try to execute the application it gives this error message:

$ java WatchDog

Cannot connect to database serverorg.gjt.mm.mysql.Driver

Exception in thread "main" java.lang.NullPointerException

at Query.truncate(Query.java:304)

at WatchDog.<init>(WatchDog.java:18)

at WatchDog.main(WatchDog.java:131)

I also tried to point to the external jar with the -classpath option like this:

$java -cp "/usr/local/bin/WatchDog/mysql-connector-java-5.0.4/mysql-connector-java-5.0.4-bin.jar" WatchDog

Exception in thread "main" java.lang.NoClassDefFoundError: WatchDog

how can I do this?

grtz

Message was edited by:

dfvdfvdfvxfv

[1044 byte] By [dfvdfvdfvxfva] at [2007-11-27 5:02:09]
# 1
by setting the classpath like that you removed your own classes from the classpath.Add the directory where those are to be found to the classpath as well.And of course ALWAYS use packages for your classes.
jwentinga at 2007-7-12 10:19:54 > top of Java-index,Java Essentials,Java Programming...