com.mysql.jdbc does not exist

Discussion in 'Java' started by bruce, Nov 1, 2010.

  1. bruce

    bruce Guest

    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-
    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?


    bruce, Nov 1, 2010
    1. Advertisements

  2. 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.
    John B. Matthews, Nov 1, 2010
    1. Advertisements

  3. bruce

    bruce Guest

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

    Thanks again....

    bruce, Nov 1, 2010
  4. bruce

    markspace Guest

    markspace, Jul 4, 2012
  5. bruce

    Lew Guest

    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.
    Lew, Jul 5, 2012
  6. bruce

    Roedy Green Guest

    Roedy Green Canadian Mind Products
    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.
    Roedy Green, Jul 5, 2012
  7. bruce

    Jeff Higgins Guest

    Jeff Higgins, Jul 5, 2012
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.