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

Note You must install the core library of the Alibaba Cloud SDK for Java regardless of the method that you use to install the Alibaba Cloud SDK for Java.

Prerequisites

Before you install and use the Alibaba Cloud SDK for Java, make sure that the following requirements are met:
  • The Java environment is installed. The Java Development Kit (JDK) version is 1.6 or later.
  • 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 the Alibaba Cloud SDK for Java:

(Recommended) Add Maven dependencies

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

Add the following Maven dependency to install the core library of the Alibaba Cloud SDK for Java.
<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-core</artifactId>
  <version>4.5.0</version>
</dependency>

Import JAR files to the integrated development environment

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

  • Eclipse
    To install the 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 choose 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 the 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 the Alibaba Cloud SDK for Java is installed, you can use OpenAPI Explorer to generate the sample code of API operations for the SDK, and apply the sample code in your projects.

Core library of the Alibaba Cloud SDK for Java on GitHub

Core library of the Alibaba Cloud SDK for Java