0

when i try to run a project

java -jar test.jar    

i get the following exception

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver                    
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

how to add mysql-connector-java-5.1.22-bin.jar in classpath

John Woo
  • 258,903
  • 69
  • 498
  • 492
akash
  • 1,801
  • 7
  • 24
  • 42

2 Answers2

1

Maybe you have forget to add the library in your project. Please see the links below

John Woo
  • 258,903
  • 69
  • 498
  • 492
1

You should be having jdbc driver classes in your classpath.

Arun R U
  • 73
  • 9
  • Akash, This link will help you. [Adding Classes to the JAR File's Classpath](http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html) – Arun R U Dec 22 '12 at 16:53