ClassNotFoundException in MySQL Connector/J
- by Ephraim
This has been asked before but I cannot find the answer I need.
1) Using Class.forName("com.mysql.java.Driver") in the eclipse IDE all works well. I load the correct jar (mysql-connector-java-5.1.20-bin.jar), no exception.
When I create a jar for my app a1.jar and double click the jar, I get the ClassnotFoundException.
I created a .bat file in Windows XP with
java -classpath c:\temp\mysql-connector-java-5.1.20-bin.jar -jar c:\temp\a1.jar the app statrs with the same exception.
Furthermore using System.getProperty ("java.class.path") shows c:\temp\a1.jar whilst in the IDE I can see several directories