Installing the Java driver

Before you install a driver: install RethinkDB first.

Looking for another language? See the complete list of client drivers for RethinkDB.


Using Maven

If you’re using Maven, add this to your pom.xml file:


Using Gradle

If you’re using Gradle, modify your build.gradle file:

dependencies {
    compile group: 'com.rethinkdb', name: 'rethinkdb-driver', version: '2.4.4'

Using Ant

If you’re using Ant, add the following to your build.xml:

<artifact:dependencies pathId="dependency.classpath">
  <dependency groupId="com.rethinkdb" artifactId="rethinkdb-driver" version="2.4.4" />

Using SBT

If you’re using SBT, add the following to your build.sbt:

libraryDependencies += "com.rethinkdb" % "rethinkdb-driver" % "2.4.4"


You can use the drivers from Java like this:

import com.rethinkdb.RethinkDB;
import com.rethinkdb.gen.exc.ReqlError;
import com.rethinkdb.gen.exc.ReqlQueryLogicError;
import com.rethinkdb.model.MapObject;

public static final RethinkDB r = RethinkDB.r;

Connection conn = r.connection().hostname("localhost").port(28015).connect();

r.table("tv_shows").insert(r.hashMap("name", "Star Trek TNG")).run(conn);

Next steps

Move on to the ten-minute guide and learn how to use RethinkDB.