com.mysql.jdbc does not exist

B

bruce

I am getting the error "com.mysql.jdbc does not exist" when I compile
with NetBeans.

I have mysql-connector-java-5.1.13-bin.jar set as
c:\Program Files\Java\jre6\lib\ext\mysql-connector-java-5.1.13-bin.jar

In NetBeans, I went to Tools->Libraries. Under Libraries, I have
"MYSQL JDBC Driver" Clicking on this, displays. the above setting.

I also notice that NetBeans has:
c:\Program Files\NetBeans 6.9.1\ide\modules\ext\mysql-connector-
java-5.1.6-bin.jar"
in this same Library.

Is this a problem????

My System is:
Product Version: NetBeans IDE 6.9.1 (Build 201007282301)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

What do I need to do get NetBeans to find com.mysql.jdbc?

Thanks...

Bruce
 
J

John B. Matthews

bruce said:
I am getting the error "com.mysql.jdbc does not exist" when I compile
with NetBeans.

I have mysql-connector-java-5.1.13-bin.jar set as
c:\Program Files\Java\jre6\lib\ext\mysql-connector-java-5.1.13-bin.jar

In NetBeans, I went to Tools->Libraries. Under Libraries, I have
"MYSQL JDBC Driver" Clicking on this, displays. the above setting.

I also notice that NetBeans has:
c:\Program Files\NetBeans 6.9.1\ide\modules\ext\mysql-connector-
java-5.1.6-bin.jar"
in this same Library.

Is this a problem????

My System is:
Product Version: NetBeans IDE 6.9.1 (Build 201007282301)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

What do I need to do get NetBeans to find com.mysql.jdbc?

It sounds like your library is set up correctly: you're allowed to have
different versions in different entries. Now, just add the desired
library to the project that needs it.
 
B

bruce

It sounds like your library is set up correctly: you're allowed to have
different versions in different entries. Now, just add the desired
library to the project that needs it.

Thanks.. You were absolutely correct. As soon as I told my application
about the library, the error went away..

Thanks again....

Bruce
 
L

Lew

markspace said:
Use the CLASSPATH.

Actually, don't. Use the classpath instead. CLASSPATH is an antipattern for
most use cases.

The problem with the CLASSPATH environment variable (envar) is that it affects
*every* Java program on the system. To tell the *particular* project about the
library, as the OP requested, you have to tell the *particular* project's
classpath where to find the library.

RTFM. The Oracle site goes into details about the "tools" (java, javac,
javaws, etc.) and their options.
 
R

Roedy Green

how to you tell the particular project about the library

see http://mindprod.com/jgloss/jdbc.html
--
Roedy Green Canadian Mind Products
http://mindprod.com
Why do so many operating systems refuse to define a standard
temporary file marking mechanism? It could be a reserved lead character
such as the ~ or a reserved extension such as .tmp.
It could be a file attribute bit. Because they refuse, there is no
fool-proof way to scan a disk for orphaned temporary files and delete them.
Further, you can't tell where the orhaned files ame from.
This means the hard disks gradually fill up with garbage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top