Gersom
Gersom

Reputation: 97

How to install com.mysql.jdbc.Driver on debian to connect to database java

I was working on a plugin that saves data inside of the database, but I got an exception:

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

I know that this means that the driver is not found, but I don't know how to install it. I'm using a Debian VPS, and I was wondering how to install it. Thanks in advance!

Upvotes: 0

Views: 867

Answers (1)

Ben Siebert
Ben Siebert

Reputation: 44

If you use maven you can just add this to your pom.xml:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.23</version>
    <scope>compile</scope>
</dependency>

Upvotes: 1

Related Questions