jQuery in Action, 2nd edition*
The moose likes IDEs, Version Control and other tools and the fly likes Error : class not found exception : com.mysql.jdbc.driver in eclipse Tool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Error : class not found exception : com.mysql.jdbc.driver in eclipse Tool" Watch "Error : class not found exception : com.mysql.jdbc.driver in eclipse Tool" New topic
Author

Error : class not found exception : com.mysql.jdbc.driver in eclipse Tool

Harshal Gurav
Ranch Hand

Joined: May 29, 2008
Posts: 151
Hi

I have impoted project file in eclipse in new machine using option import from existing workbence . When i stat to debug this project ,
i am getting error as class not found exception : com.mysql.jdbc.driver . my project folder already consist of mysql .jar file in /web appls/web-inf folder.
Application is running successfully in other machine from where i took the application file. As this error appeared I also added jar file into project path as Project ---->properties-- build java path---libraries----add external jar file.
kindly hep me.

Haresh
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

You might have better luck with this question in the IDEs forum because Eclipse sometimes does strange things when deploying web applications. I'll move it for you.

By the way, the JDBC JAR file should be in WEB-INF/lib (though that sometimes depends on the app server you are using, you should let us know which app server you have).


JBoss In Action
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please make sure to capitalize things properly, like WEB-INF and Driver, as these things are different, and significant.
Arati Patro
Greenhorn

Joined: Aug 17, 2011
Posts: 1
This reply is wrt the error: class not found exception : com.mysql.jdbc.driver in eclipse Tool in a Dynamic Web App.( Tomcat Server)

I faced the same and figured that apart from adding the mysqlconnector jar to the class buildpath(Project->Properties->Java Build Path->Add External Jar), you need to copy paste the jar in the WEBINF folder of your project as well.
Ideally, restart IDE after this.

Hope this helped.

Arati Patro, Bangalore
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Welcome to the Ranch.

I take it you are using Eclipse.
I faced the same and figured that apart from adding the mysqlconnector jar to the class buildpath(Project->Properties->Java Build Path->Add External Jar), you need to copy paste the jar in the WEBINF folder of your project as well. Ideally, restart IDE after this.

Not really. As Peter mentioned, it should be under WEB-INF/lib. Once you put it there, its an "internal" jar! No restart required.

..wrt..

Please UseRealWords


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error : class not found exception : com.mysql.jdbc.driver in eclipse Tool
 
Similar Threads
[Eclipse]: class Nodefound error
jsp - jar - dll
jdbc error at runtime - org.postgresql.Driver
Trouble in running the web application in WSAD v 6
java.lang.NoClassDefFoundError for interface of included project