redis How to Connect to Redis in Java using Jedis Getting Jedis


The Jedis library is generally added to Java project using a dependency management system built into the build environment of the project. Two popular Java build systems are Maven and Gradle.

Using Gradle

To add the Jedis library to a Gradle project, you will need configure a repository and add a dependency. The following snippet shows how to add version 2.9.0 of the Jedis library to a Gradle project.

repositories {

dependencies {
    compile 'redis.clients:jedis:2.9.0'

Using Maven

To add Jedis to a Maven project, you need to add a dependency to your dependency list and provide the coordinates of the library. The following snippet would be added to your pom.xml file: