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

Prerequisites

Before you install and use the Java SDK, 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 and AccessKey pair are created. For more information, see Obtain an AccessKey pair.

Installation methods

You can use the following two methods to install the Java SDK:
  • Add Maven dependencies. This method applies to the Java projects that are managed by using Maven.
  • Import JAR files to the integrated development environment (IDE). This method applies to the projects that are deployed in Eclipse or IntelliJ IDEA.

Add Maven dependencies

If you use Maven to manage Java projects, you can add Maven dependencies to the pom.xml file to install the Java SDK. 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 the Java SDK.
<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-core</artifactId>
  <version>4.5.22</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.
maven

Import JAR files to the IDE

Install Alibaba Cloud Java SDK by importing aliyu-java-sdk-core JAR files.

  • Eclipse
    To install the Java SDK in Eclipse, perform the following operations:
    1. Download the aliyun-java-sdk-core.jar file to your project folder.
    2. Open your project in Eclipse, 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 Java SDK in IntelliJ IDEA, perform the following operations:
    1. Download the aliyun-java-sdk-core.jar file and decompress it to your project folder.
    2. Open your project in IntelliJ, choose File > Project Structure > Modules in the menu bar, click the plus sign on the right, and select the corresponding Jar or file.
    3. Click Apply and then OK.

Core library of the Java SDK on GitHub

Core library of the Java SDK