11 messages in com.mysql.lists.javaRe: mysql & jdbc drivers| From | Sent On | Attachments |
|---|---|---|
| Robert H. Thompson | 21 Apr 1999 13:48 | |
| Alex Rice | 21 Apr 1999 13:56 | |
| Steve Nguyen | 21 Apr 1999 23:21 | |
| Jim Ridenour | 22 Apr 1999 03:19 | |
| Harald Schlang | 22 Apr 1999 03:31 | |
| mmat...@ecn.purdue.edu | 22 Apr 1999 06:02 | |
| Scott Ruttencutter | 22 Apr 1999 11:31 | |
| Jim Ridenour | 23 Apr 1999 05:04 | |
| Robert H. Thompson | 23 Apr 1999 06:34 | |
| Christian Mack | 23 Apr 1999 11:48 | |
| Hans Wolters | 23 Apr 1999 13:36 |
| Subject: | Re: mysql & jdbc drivers![]() |
|---|---|
| From: | mmat...@ecn.purdue.edu (mmat...@ecn.purdue.edu) |
| Date: | 04/22/1999 06:02:21 AM |
| List: | com.mysql.lists.java |
On Thu, 22 Apr 1999, Jim Ridenour wrote:
At 04:48 PM 4/21/99 -0400, Robert H. Thompson wrote:
I am having a problem with the twz1FM and mm.mysql jdbc drivers for the MySql database. At home I have red hat linux 5.2 kernel 2.0.36 with the latest mysql and twz1ForMysql driver and mm.mysql driver. and the blackdown jdk1.2 port.
1) I explicitly compile with:
javac -classpath /mysql/twz1/twz1ForMysql.jar jdbctest1.java
and the program compiles fine.
I try to run it with:
java jdbctest1
and I get java NoClassDefFound Error
what am I missing here?
You need to have the mysql drivers in your classpath when you run the program as well as when you compile it.
Java doesn't link at compile time, it loads classes at run time, so all classes need to be available at run time as well as compile time.
-Mark
-- Mark Matthews <mmat...@ecn.purdue.edu> http://www.ccm.ecn.purdue.edu/~mmatthew/ "Computers in the future may weigh no more than 2 tons." -Pop.Mech., 1947




