The Alibaba Cloud V1.0 SDK will soon enter the Basic Security Maintenance phase and is no longer recommended for use. V2.0 SDK is available here: https://github.com/aliyun/alibabacloud-java-sdk
Java
1,416
6,945 commits
updated Oct 15, 2026
English | 简体中文
⚠️ Important Notice: Alibaba Cloud V1.0 Java SDK has entered the basic security maintenance phase and is no longer recommended for use. New users should directly use the V2.0 Java SDK; users who have already integrated the V1.0 Java SDK are also advised to migrate to the V2.0 Java SDK.
V2.0 Java SDK usage please refer to Help Center Documentation and Alibaba Cloud OpenAPI Developer Portal.
The Alibaba Cloud SDK for Java (V1.0) allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.
This document introduces how to obtain and call Alibaba Cloud SDK for Java (V1.0).
If you have any problem while using Alibaba Cloud SDK for Java (V1.0), please submit an issue.
Alibaba Cloud V1.0 Java SDK has entered the basic security maintenance phase and is no longer recommended for use.
AccessKey ID and an AccessKey Secret. Create and view your AccessKey on the RAM console or contact your system administrator.If you use Apache Maven to manage Java projects, you only need to add corresponding dependencies to the pom.xml files of the projects. You can view the Maven dependencies of different cloud products in Alibaba Cloud SDK Center.
You must install aliyun-java-sdk-core library no matter which product development kit you want to use. For example, to call the ECS SDK, you need to install aliyun-java-sdk-core library and aliyun-java-sdk-ecs library .
To use the Ecs SDK as an example, you only need to declare the following two dependencies in the pom.xml file.
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>[4.6.3,5.0.0)</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-ecs</artifactId>
<version>[4.16.0,5.0.0)</version>
</dependency>
If maven is not downloading jar packages from a central repository, you need to add these dependencies in the pom.xml file, or a NoClassDefFoundError exception will be reported
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
<version>0.33.0</version>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
<version>0.33.0</version>
</dependency>
Troubleshoot Provide OpenAPI diagnosis service to help developers quickly locate and troubleshoot errors by using RequestID or error message, and provide solutions.
The following code example shows how to use Alibaba Cloud SDK for Java :
package com.testprogram;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.ecs.model.v20140526.*;
public class Main {
public static void main(String[] args) {
// 1. Create and initialize a DefaultAcsClient instance
DefaultProfile profile = DefaultProfile.getProfile(
"<your-region-id>", // The region ID
"<your-access-key-id>", // The AccessKey ID of the RAM account
"<your-access-key-secret>"); // The AccessKey Secret of the RAM account
IAcsClient client = new DefaultAcsClient(profile);
// 2. Create an API request and set parameters
DescribeInstancesRequest request = new DescribeInstancesRequest();
request.setPageSize(10);
// 3. Initiate the request and handle the response or exceptions
DescribeInstancesResponse response;
try {
response = client.getAcsResponse(request);
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
System.out.println(instance.getPublicIpAddress());
}
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
e.printStackTrace();
}
}
}
For security reason, we don't recommend to hard code credentials information in source code. You should access credentials from external configurations or environment variables.
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Detailed changes for each release are documented in the release notes.
Please make sure to read the Contributing Guide before making a pull request.
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
1,505 followers · starred Jun 2017
144 followers · starred Apr 2019
42 followers · starred Dec 2017
16 followers · starred Mar 2019
The Alibaba Cloud V1.0 SDK will soon enter the Basic Security Maintenance phase and is no longer recommended for use. V2.0 SDK is available here: https://github.com/aliyun/alibabacloud-java-sdk
Java
1,416
6,945 commits
updated Oct 15, 2026
English | 简体中文
⚠️ Important Notice: Alibaba Cloud V1.0 Java SDK has entered the basic security maintenance phase and is no longer recommended for use. New users should directly use the V2.0 Java SDK; users who have already integrated the V1.0 Java SDK are also advised to migrate to the V2.0 Java SDK.
V2.0 Java SDK usage please refer to Help Center Documentation and Alibaba Cloud OpenAPI Developer Portal.
The Alibaba Cloud SDK for Java (V1.0) allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.
This document introduces how to obtain and call Alibaba Cloud SDK for Java (V1.0).
If you have any problem while using Alibaba Cloud SDK for Java (V1.0), please submit an issue.
Alibaba Cloud V1.0 Java SDK has entered the basic security maintenance phase and is no longer recommended for use.
AccessKey ID and an AccessKey Secret. Create and view your AccessKey on the RAM console or contact your system administrator.If you use Apache Maven to manage Java projects, you only need to add corresponding dependencies to the pom.xml files of the projects. You can view the Maven dependencies of different cloud products in Alibaba Cloud SDK Center.
You must install aliyun-java-sdk-core library no matter which product development kit you want to use. For example, to call the ECS SDK, you need to install aliyun-java-sdk-core library and aliyun-java-sdk-ecs library .
To use the Ecs SDK as an example, you only need to declare the following two dependencies in the pom.xml file.
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>[4.6.3,5.0.0)</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-ecs</artifactId>
<version>[4.16.0,5.0.0)</version>
</dependency>
If maven is not downloading jar packages from a central repository, you need to add these dependencies in the pom.xml file, or a NoClassDefFoundError exception will be reported
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
<version>0.33.0</version>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
<version>0.33.0</version>
</dependency>
Troubleshoot Provide OpenAPI diagnosis service to help developers quickly locate and troubleshoot errors by using RequestID or error message, and provide solutions.
The following code example shows how to use Alibaba Cloud SDK for Java :
package com.testprogram;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.ecs.model.v20140526.*;
public class Main {
public static void main(String[] args) {
// 1. Create and initialize a DefaultAcsClient instance
DefaultProfile profile = DefaultProfile.getProfile(
"<your-region-id>", // The region ID
"<your-access-key-id>", // The AccessKey ID of the RAM account
"<your-access-key-secret>"); // The AccessKey Secret of the RAM account
IAcsClient client = new DefaultAcsClient(profile);
// 2. Create an API request and set parameters
DescribeInstancesRequest request = new DescribeInstancesRequest();
request.setPageSize(10);
// 3. Initiate the request and handle the response or exceptions
DescribeInstancesResponse response;
try {
response = client.getAcsResponse(request);
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
System.out.println(instance.getPublicIpAddress());
}
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
e.printStackTrace();
}
}
}
For security reason, we don't recommend to hard code credentials information in source code. You should access credentials from external configurations or environment variables.
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Detailed changes for each release are documented in the release notes.
Please make sure to read the Contributing Guide before making a pull request.
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
1,505 followers · starred Jun 2017
144 followers · starred Apr 2019
42 followers · starred Dec 2017
16 followers · starred Mar 2019