This topic describes how to install the server SDK for Java and provides sample code.

Prerequisites

JDK 6 or later is installed.

Install the server SDK for Java

Note
  • You must install the SDK core library and ApsaraVideo VOD library. For more information, see SDK overview and download. We recommend that you download the latest version.
  • You must install the core library aliyun-java-sdk-core V4.4.5 or later.
  • You must install the ApsaraVideo VOD library aliyun-java-sdk-vod. If new API operations or new features of existing API operations are unavailable in the current version of the SDK, update the SDK to the latest version. For more information about the versions and release notes, see Release notes for server operation SDKs. In this topic, the version numbers are displayed in the Version column.
  • If you use Key Management Service (KMS), you must add the aliyun-java-sdk-kms dependency to your project.
  • The version numbers included in the following sample code are for reference only. Replace the version numbers based on your business requirements.
Add JAR file dependencies:
<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-core</artifactId>
  <version>4.6.0</version>
</dependency>
<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-vod</artifactId>
  <version>2.16.10</version>
</dependency>
<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>fastjson</artifactId>
  <version>1.2.83</version>
</dependency>
<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-kms</artifactId>
  <version>2.10.1</version>
</dependency>