Cannot load driver class: com.mysql.cj.jdbc.Driver
Have you checked which version of MySQL connector do you have?
Since you haven't specified the version in your pom.xml, there is a chance that it pulled version 5 and now it is complaining about that .cj which is required for version 8.
That might be the reason why is it working without .cj ( com.mysql.jdbc.Driver ), because it pulled the version 5.
Manually add the version in your pom.xml and keep .cj as it is.
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.16</version>
</dependency>
After that make sure that you pull your dependencies.
But make sure that you check in your project if you do have ONLY version 8 after "mvn clean install".
As of the picture that you shared "mysql version", that means nothing, the exception is regarding mysql-connector jar, it has nothing to do with the workbench, you can still have workbench version 5, and use mysql-connector jar version 8, it will make no difference.
In any version of mysql workbench ( 5 or 8 ):
mysql-connector 8 jar = requires .cj
mysql-connector 5 jar = does not require .cj
The only thing that you need to do is define the version of mysql-connector-java in your pom.xml
Failed to load driver class com.mysql.jdbc.Driver
The answer is so embarrassing. I appended the driver line of application.properties with a semicolon ...
Obviously, it did't recognize that driver.
Related Topics
Kafka Consumer in Java Not Consuming Messages
Javafx Column in Tableview Auto Fit Size
Jackson Deserialization Issue for Zoneddatetime
Using Loop to Accept Additional User Input Until User Enters a Value That Ends the Input
How to Execute SQL Script File in Java
Hibernate Error - Querysyntaxexception: Users Is Not Mapped [From Users]
How to Run Single Cucumber Feature Files Through Command Prompt and Through Jenkins Using Maven
Selenium Web Driver: Cannot Be Scrolled into View
How to Input Date Using Sendkeys in Selenium Webdriver
Ora-00942 Sqlexception With Hibernate (Unable to Find a Table)
How to Get Row Count Using Resultset in Java
Custom Pagination by Array List
Adding a Custom Http Header to a Spring Boot Ws Call (Wstemplate)
How to Query Dynamodb Based on Partition Key and Sort Key [Java]
A Better Way to Convert Integer (May Be Null) to Int in Java
Turning Sonar Off for Certain Code