This topic describes how to add Maven dependencies and download SDK tools to install Alibaba Cloud SDK for Java.

Note When you install Alibaba Cloud SDK for Java, you must also install the core library of the SDK.

Prerequisites

Before you install and use Alibaba Cloud SDK for Java, make sure that the following requirements are met:
  • The Java environment is installed. Java Development Kit (JDK) version 1.6 or later is used.
  • An Alibaba Cloud account is created and an AccessKey pair is created. For more information, see Create an AccessKey pair.

Installation methods

You can use the following two methods to install Alibaba Cloud SDK for Java:

(Recommended) Add Maven dependencies

If you use Maven to manage Java projects, you can add Maven dependencies to the pom.xml file to install Alibaba Cloud SDK for Java. In the Maven repository, you can view the Maven dependencies of Alibaba Cloud services.

Add the following Maven dependency to install the core library of Alibaba Cloud SDK for Java.
<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-core</artifactId>
  <version>4.5.17</version>
</dependency>
Note The version that is used in the preceding dependency is a sample version. For information about the latest version of the core library, visit the Maven repository.

Import JAR files to the integrated development environment

If you use Eclipse or IntelliJ as the integrated development environment, you can install Alibaba Cloud SDK for Java by importing the aliyu-java-sdk-core JAR file.

  • Eclipse
    To install Alibaba Cloud SDK for Java in Eclipse, perform the following operations:
    1. Download the aliyun-java-sdk-core.jar file and copy the file to your project folder.
    2. In Eclipse, open your project, right-click the project, and then click Properties from the shortcut menu.
    3. In the dialog box that appears, choose Java Build Path > Libraries > Add JARs to add the downloaded JAR file.
    4. Click Apply and Close.
  • IntelliJ
    To install Alibaba Cloud SDK for Java in IntelliJ, perform the following operations:
    1. Download the aliyun-java-sdk-core.jar file and copy the file to your project folder.
    2. In IntelliJ, open your project. In the menu bar, choose File > Project Structure.
    3. Click Apply and then click OK.

After Alibaba Cloud SDK for Java is installed, you can use OpenAPI Explorer to generate sample code of API operations for the SDK, and apply the sample code in your projects.

Core library of Alibaba Cloud SDK for Java on GitHub

Core library of Alibaba Cloud SDK for Java