Reputation: 1537
Using tomcat 8 with Eclipse Cannot load JDBC driver class 'com.mysql.jdbc.Driver' ::: I have added mysql connecter every where and I still can't connect.
WEB-INF/lib/
Java Resources/Libraries/
tomcat/lib/ // however I don't see the jar file in my project
web.xml
Tomcat Context.xml
Upvotes: 8
Views: 39799
Reputation: 19
This comment is posted up and is fine but between steaps 2 and 3 you have to do step 2.50. You just forgot to import jar files into project path.
Give Right click on project
properties
Library
mysql connector
from zip fileUpvotes: 0
Reputation: 148
In my case I fixed this issue as it was happening with tomcat7 7.0.56 on debian 8.11 and apparently this tomcat7 version has some beef with this debian. When I downgraded to tomcat7 7.0.28 this error got fixed since jar was everywhere and only tomcat7 could have been the reason for not getting loaded. I hope this helps someone else save the time that I lost debugging this one
Upvotes: 0
Reputation: 848
Another thing you can try that worked for me is to add the mysql connector jar directly to the folder. Of course change to your environment.
C:[YOUR PATH]\apache-tomcat-8.5.24\lib
mysql-connector-java-5.1.45.jar
Upvotes: 6
Reputation: 221
Give Right click on project
Upvotes: 1
Reputation: 2073
You need to add the mysql jar in classpath of Run Configurations.
To do this choose menu Run > Run Configuration > Select your Tomcat Installation and the classpath tab. Click on button Add External JARs...
Upvotes: 10