-1

Guys I can't load my jdbc driver, even though I have dependency for mysql-connector-java and as you can see I gotmy mysql.connector-java jar downloaded by hibernate...any suggestions what am I doing wrong?enter image description here

As you can see on image, dependencies are good and jar file is downloaded.

HTF
  • 33
  • 1
  • 8
  • Possible duplicate of [java.lang.ClassNotFoundException in spite of using CLASSPATH environment variable](https://stackoverflow.com/questions/2591505/java-lang-classnotfoundexception-in-spite-of-using-classpath-environment-variabl) – Tibrogargan May 23 '18 at 22:07
  • There are more than a few questions that talk about this issue, did you look at any of them before you posted? Also, do not link to offsite resources in your question or use images of text, especially for things people might want to copy / paste (i.e. code or error messages) – Tibrogargan May 23 '18 at 22:09
  • I added this screenshot because it shows exactly that the advice from the other questions has already been applied here. – HTF May 23 '18 at 22:12
  • Your compile classpath is not the same as your execution classpath, so it's pretty obvious that no, it doesn't show the advice from the other questions. Precisely the opposite – Tibrogargan May 23 '18 at 22:14
  • Please don't post images, post your code and the exception stacktrace as (code-formatted) text. – Mark Rotteveel May 24 '18 at 09:54
  • In any case, you may want to consider upgrading your Java version. Java 5 is ancient, and I'm not sure if MySQL Connector/J 8.0 will actually work with such an old version. I also note that your stacktrace contains an error about opening a JAR file (_"Invalid LOC header (bad signature)"_), which could mean that this jar (or another jar) is corrupt (or possibly zipped in a way that is not supported by Java 5?) – Mark Rotteveel May 24 '18 at 09:56
  • Possibly related: https://stackoverflow.com/questions/23310474/hibernate-commons-annotations-4-0-1-final-jar-invalid-loc-header-bad-signature – Mark Rotteveel May 24 '18 at 09:57

1 Answers1

0

Answer for the people who struggle with the same issue: problem was with jar downloaded by maven. Just go to C:/Users/YourUserName/.m2 and delete mysql folder. Then rightclick on your project and maven -> update project or just click alt + f5, this helped me.

HTF
  • 33
  • 1
  • 8