jebnutykokot jebnutykokot - 25 days ago 17
Java Question

How to import java mysql connector to IntelliJ?

how can I import mysql-connector-java-5.1.40-bin.jar file to IntelliJ? I was searching about hour but I cant find nothing.

Answer

If you use Gradle:

Just add this line to build.gradle within dependencies { ... }:

compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.40'

If you use Maven:

Add these lines:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.40</version>
</dependency>

If you want to add it without using any build automation systems:

Just drag & drop it to your project and right-click it and choose Add jar as library...

Comments