Tablestore provides SDKs for multiple mainstream programming languages. This topic describes how to install Tablestore SDK for Java.
Prepare an environment
JDK 6.0 or later is available.
A Java development tool, such as IntelliJ IDEA and Eclipse, is installed.
Installation methods
You can install Tablestore SDK for Java by using one of the following two methods:
In the examples in this topic, Tablestore SDK for Java V5.17.2 is installed. For information about Tablestore SDK for Java of other versions, see Version history of Tablestore SDK for Java.
Maven project
To use Tablestore SDK for Java in a Maven project, you need to only add the corresponding dependencies to the pom.xml file. Add the following code to <dependencies>
of the file:
<dependency>
<groupId>com.aliyun.openservices</groupId>
<artifactId>tablestore</artifactId>
<version>5.17.2</version>
</dependency>
Eclipse project
To use Tablestore SDK for Java in a Java project of Eclipse, import JAR packages into the project by performing the following steps:
Download the Tablestore SDK for Java package.zip.
Decompress the package.
In Eclipse, select your project and choose
.Go to the package folder that you decompressed in Step 2, select all JAR packages in the tablestore-5.17.2.jar package and the lib folder, and then click Open to import the JAR packages.
Make sure that all the preceding JAR packages are imported to Libraries, and click Apply and Close to apply the project configuration.
If you use JavaSE-9 or later, import the JAR packages to Modulepath of Libraries.
Sample programs
Tablestore SDK for Java provides a variety of sample programs for your reference or use. You can decompress the downloaded SDK package and view the sample programs in the examples folder.
References
After you install Tablestore SDK for Java, you must initialize an OTSClient instance for subsequent table and data operations. For more information, see Initialize an OTSClient instance.