Installation
In this section, you will learn how to install the Java SDK in your project.
Install the SDK
First, install the SurrealDB SDK from the Maven Central repository using Gradle or Maven.
ext {
surrealdbVersion = "0.2.1"
}
dependencies {
implementation "com.surrealdb:surrealdb:${surrealdbVersion}"
}
val surrealdbVersion by extra("0.2.1")
dependencies {
implementation("com.surrealdb:surrealdb:${surrealdbVersion}")
}
<dependency>
<groupId>com.surrealdb</groupId>
<artifactId>surrealdb</artifactId>
<version>0.2.1</version>
</dependency>
Import the SDK to your project
After installing, you can access the SDK by importing from the com.surrealdb package.
import com.surrealdb.Surreal;
...
Surreal surreal = new Surreal();
In the Quick Start guide, you will learn how to create a new connection and authenticate users using the SDK.
Next Steps
After installing the SDK, check out the quick start guide to build your a simple application with the SDK. You can also learn more about carrying out common tasks with the SDK in the following sections: