Click here to Skip to main content
15,936,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,
I have a problem in my java code. Actualy, the java code has to connect to a MySQL database. For this, I have downloaded connector and got a jar file.
Now i copied that jar file in C:\Program Files (x86)\Java\jdk1.6.0_07\lib and then set the classpath but still it java-compiler give ClassNotFoundException message for statement Class.forName("com.mysql.jdbc.Driver")
Richard MacCutchan 2-Apr-12 10:36am    
Check the names and the exact spellings (upper/lower case). When you say the java-compiler gives this message do you really mean the Java runtime?

1 solution

add the lib directly to your project - make a folder "res" and inside there a folder "lib". That's common practice.

Then add the lib to your project (right click on Project -> properties -> build path -> libraries -> add...).

You can als add other files to that folder "res" like images, print templates, translation files and all stuff like that.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900