Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7942257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:54:58+00:00 2026-06-03T23:54:58+00:00

I have added my mysql-connector-java-5.1.18-bin.jar to jre and jdk libs. And Here it is:

  • 0

I have added my mysql-connector-java-5.1.18-bin.jar to jre and jdk libs. And Here it is:

C:\Windows\system32>javap java.io.Bits
    Compiled from "Bits.java"
    class java.io.Bits extends java.lang.Object{
        java.io.Bits();
        static boolean getBoolean(byte[], int);
        static char getChar(byte[], int);
        static short getShort(byte[], int);
        static int getInt(byte[], int);
        static float getFloat(byte[], int);
        static long getLong(byte[], int);
        static double getDouble(byte[], int);
        static void putBoolean(byte[], int, boolean);
        static void putChar(byte[], int, char);
        static void putShort(byte[], int, short);
        static void putInt(byte[], int, int);
        static void putFloat(byte[], int, float);
        static void putLong(byte[], int, long);
        static void putDouble(byte[], int, double);
    }


    C:\Windows\system32>javap com.mysql.jdbc.Driver
    ERROR:Could not find com.mysql.jdbc.Driver

But when I show a direct classpath to the same file, it is ok.

C:\Windows\system32>javap -classpath "B:\Java\Tools\mysql-connector-java-5.1.18\
mysql-connector-java-5.1.18\mysql-connector-java-5.1.18-bin.jar" com.mysql.jdbc.
Driver
Compiled from "Driver.java"
public class com.mysql.jdbc.Driver extends com.mysql.jdbc.NonRegisteringDriver i
mplements java.sql.Driver{
    public com.mysql.jdbc.Driver()       throws java.sql.SQLException;
    static {};
}

The problem started when I was using Thilo’s answer to load driver dynamically. There is no IOException. But on the string Class.forName(driver).newInstance() I have ClassNotFoundException exception. After adding jar to jre, nothing has changed. What is wrong with that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:54:59+00:00Added an answer on June 3, 2026 at 11:54 pm

    What exactly do you mean by After adding jar to jre? I fear mysql-connector-java-5.1.18-bin.jar is not properly added to classpath. The ClassNotFoundException is only thrown when that class is not present in the searchable classpath. All the jars that come with JDK are bootstrap classes and are available for java to load them. All third party classes however need to be set in a searchable system or application level classpath so that java can load the specified class argument.

    Try following commands at your command prompt and execute your java class.

    set mysqljar="absolute-path-to\mysql-connector-java-5.1.18-bin.jar"  
    set classpath=%classpath%;.;%mysqljar%
    

    So long as this jar is available in searchable classpath, all class loaders can find and load class from the jar. Try this change and run Thilo’s example and it should be working.

    Also read more on class paths, for command line, here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added a field in my MySQL Database, which is a DateTime field.
I have a problem with MySql.Data in a partial trusted environment. I've added MySql.Data
I have a MySQL user added to a database that I would like to
I have the following MySQL/InnoDB table. I added a compound index as the primary
I have a table which already contains an index in MySQL. I added some
I have a Spring+hibernate+mysql+jstl architecture, running in a linux CENTOS production enviroment. I added
I have a Java program which does CRUD on a MySQL database. For this,
I have a Java application that connects to a MySQL database and uses a
I have added an image into a MySql database. And I am trying to
I have created a new silverlight business application. I have added mysql.data, mysql.web, mysql.data.entity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.