Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c7391e

Browse files
authored
Merge pull request aliyun#220 from ssy352959096/readme
update readme
2 parents aa5a06f + 457fba1 commit 4c7391e

File tree

4 files changed

+78
-80
lines changed

4 files changed

+78
-80
lines changed

README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ If you have any problem while using Alibaba Cloud SDK for Java, please [submit a
2222

2323
## Requirements
2424

25-
- To use Alibaba Cloud SDK for Java, you must have an Alibaba Cloud account as well as an `AccessKey ID` and an `AccessKey Secret`. Create and view your AccessKey on the [RAM console](https://ram.console.aliyun.com "RAM console") or contact your system administrator.
25+
- To use Alibaba Cloud SDK for Java, you must have an Alibaba Cloud account as well as an `AccessKey ID` and an `AccessKey Secret`. Create and view your AccessKey on the [RAM console](https://ram.console.aliyun.com "RAM console") or contact your system administrator.
2626

27-
- To use the Alibaba Cloud SDK for Java to access the APIs of a product, you must first activate the product on the [Alibaba Cloud console](https://home.console.aliyun.com/?spm=5176.doc52740.2.4.QKZk8w) if required.
27+
- To use the Alibaba Cloud SDK for Java to access the APIs of a product, you must first activate the product on the [Alibaba Cloud console](https://home.console.aliyun.com/?spm=5176.doc52740.2.4.QKZk8w) if required.
2828

29-
- The Alibaba Cloud Java SDK requires JDK 1.6 or later.
29+
- The Alibaba Cloud Java SDK requires JDK 1.6 or later.
3030

3131
## Installation
3232

33-
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 download the Maven dependencies of different cloud products in [Alibaba Cloud SDK](https://www.alibabacloud.com/support/developer-resources?spm=a3c0i.7911826.675768.dnavresources1.32a0737buJ2Rr4).
33+
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 download the Maven dependencies of different cloud products in [Alibaba Cloud developer resources](https://help.aliyun.com/learn/developer.html).
3434

35-
You must install the SDK core library for any SDK you use. For example, to call the ECS SDK, you must install both the ECS SDK and the Alibaba Cloud SDK for Java core library.
35+
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 .
3636

37-
For example, with Alibaba Cloud SDK for Java core library latest version and ECS SDK latest version, you need to declare the two SDKs in the pom.xml file.
37+
To use the Ecs SDK as an example, you only need to declare the following two dependencies in the `pom.xml` file.
3838

3939
```xml
4040
<dependency>
@@ -69,38 +69,38 @@ The following code example shows the three main steps to use Alibaba Cloud SDK f
6969
3. Initiate the request and handle the response or exceptions.
7070

7171
```java
72-
package com.testprogram;
73-
import com.aliyuncs.profile.DefaultProfile;
74-
import com.aliyuncs.DefaultAcsClient;
75-
import com.aliyuncs.IAcsClient;
76-
import com.aliyuncs.exceptions.ClientException;
77-
import com.aliyuncs.exceptions.ServerException;
78-
import com.aliyuncs.ecs.model.v20140526.*;
79-
public class Main {
80-
public static void main(String[] args) {
81-
// Create and initialize a DefaultAcsClient instance
82-
DefaultProfile profile = DefaultProfile.getProfile(
83-
"<your-region-id>", // The region ID
84-
"<your-access-key-id>", // The AccessKey ID of the RAM account
85-
"<your-access-key-secret>"); // The AccessKey Secret of the RAM account
86-
IAcsClient client = new DefaultAcsClient(profile);
87-
// Create an API request and set parameters
88-
DescribeInstancesRequest request = new DescribeInstancesRequest();
89-
request.setPageSize(10);
90-
// Initiate the request and handle the response or exceptions
91-
DescribeInstancesResponse response;
92-
try {
93-
response = client.getAcsResponse(request);
94-
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
95-
System.out.println(instance.getPublicIpAddress());
96-
}
97-
} catch (ServerException e) {
98-
e.printStackTrace();
99-
} catch (ClientException e) {
100-
e.printStackTrace();
101-
}
102-
}
103-
}
72+
package com.testprogram;
73+
import com.aliyuncs.profile.DefaultProfile;
74+
import com.aliyuncs.DefaultAcsClient;
75+
import com.aliyuncs.IAcsClient;
76+
import com.aliyuncs.exceptions.ClientException;
77+
import com.aliyuncs.exceptions.ServerException;
78+
import com.aliyuncs.ecs.model.v20140526.*;
79+
public class Main {
80+
public static void main(String[] args) {
81+
// Create and initialize a DefaultAcsClient instance
82+
DefaultProfile profile = DefaultProfile.getProfile(
83+
"<your-region-id>", // The region ID
84+
"<your-access-key-id>", // The AccessKey ID of the RAM account
85+
"<your-access-key-secret>"); // The AccessKey Secret of the RAM account
86+
IAcsClient client = new DefaultAcsClient(profile);
87+
// Create an API request and set parameters
88+
DescribeInstancesRequest request = new DescribeInstancesRequest();
89+
request.setPageSize(10);
90+
// Initiate the request and handle the response or exceptions
91+
DescribeInstancesResponse response;
92+
try {
93+
response = client.getAcsResponse(request);
94+
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
95+
System.out.println(instance.getPublicIpAddress());
96+
}
97+
} catch (ServerException e) {
98+
e.printStackTrace();
99+
} catch (ClientException e) {
100+
e.printStackTrace();
101+
}
102+
}
103+
}
104104
```
105105

106106
## Documentation

README_zh.md

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[English](./README.md) | 简体中文
22

33
<p align="center">
4-
<a href=" https://www.alibabacloud.com"><img src="https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg"></a>
4+
<a href=" https://www.alibabacloud.com"><img src="https://aliyunsdk-pages.alicdn.com/icons/Aliyun.svg"></a>
55
</p>
66

77
<h1 align="center">Alibaba Cloud SDK for Java</h1>
@@ -24,10 +24,10 @@
2424
3. Alibaba Cloud SDK for Java 需要1.6以上的JDK。
2525

2626
## 安装依赖
27-
无论您要使用哪个产品的开发工具包,都必须安装`SDK核心库`。比如,对云服务器SDK的调用,您需要安装`SDK核心库``云服务器`的SDK
27+
无论您要使用哪个产品的开发工具包,都必须安装`aliyun-java-sdk-core`。比如,对云服务器SDK的调用,您需要安装`aliyun-java-sdk-core``aliyun-java-sdk-ecs`
2828
#### 通过Maven来管理项目依赖(推荐)
29-
如果您使用Apache Maven来管理Java项目,只需在项目的`pom.xml`文件加入相应的依赖项即可。您可以在[阿里云开发工具包](https://develop.aliyun.com/tools/sdk#/java)中下载各云产品的Maven依赖。
30-
以最新版本的SDK核心库和最新版本的Ecs SDK为例,您只需在`pom.xml`中声明这两个开发工具包,如下所示
29+
如果您使用Apache Maven来管理Java项目,只需在项目的`pom.xml`文件加入相应的依赖项即可。您可以在[阿里云开发者资源](https://help.aliyun.com/learn/developer.html)中下载各云产品的Maven依赖。
30+
以使用Ecs SDK为例,您只需在`pom.xml`中声明以下两个依赖
3131
```xml
3232
<dependency>
3333
<groupId>com.aliyun</groupId>
@@ -57,39 +57,38 @@
5757
3. 发起请求并处理应答或异常。
5858

5959
```java
60-
package com.testprogram;
61-
import com.aliyuncs.profile.DefaultProfile;
62-
import com.aliyuncs.DefaultAcsClient;
63-
import com.aliyuncs.IAcsClient;
64-
import com.aliyuncs.exceptions.ClientException;
65-
import com.aliyuncs.exceptions.ServerException;
66-
import com.aliyuncs.ecs.model.v20140526.*;
67-
public class Main {
68-
public static void main(String[] args) {
60+
package com.testprogram;
61+
import com.aliyuncs.profile.DefaultProfile;
62+
import com.aliyuncs.DefaultAcsClient;
63+
import com.aliyuncs.IAcsClient;
64+
import com.aliyuncs.exceptions.ClientException;
65+
import com.aliyuncs.exceptions.ServerException;
66+
import com.aliyuncs.ecs.model.v20140526.*;
67+
public class Main {
68+
public static void main(String[] args) {
6969
// 创建DefaultAcsClient实例并初始化
70-
DefaultProfile profile = DefaultProfile.getProfile(
71-
"<your-region-id>", // 地域ID
72-
"<your-access-key-id>", // RAM账号的AccessKey ID
73-
"<your-access-key-secret>"); // RAM账号Access Key Secret
74-
IAcsClient client = new DefaultAcsClient(profile);
70+
DefaultProfile profile = DefaultProfile.getProfile(
71+
"<your-region-id>", // 地域ID
72+
"<your-access-key-id>", // RAM账号的AccessKey ID
73+
"<your-access-key-secret>"); // RAM账号Access Key Secret
74+
IAcsClient client = new DefaultAcsClient(profile);
7575
// 创建API请求并设置参数
76-
DescribeInstancesRequest request = new DescribeInstancesRequest();
77-
request.setPageSize(10);
78-
// 发起请求并处理应答或异常
79-
DescribeInstancesResponse response;
80-
try {
81-
response = client.getAcsResponse(request);
82-
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
83-
System.out.println(instance.getPublicIpAddress());
84-
}
85-
} catch (ServerException e) {
86-
e.printStackTrace();
76+
DescribeInstancesRequest request = new DescribeInstancesRequest();
77+
request.setPageSize(10);
78+
// 发起请求并处理应答或异常
79+
DescribeInstancesResponse response;
80+
try {
81+
response = client.getAcsResponse(request);
82+
for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
83+
System.out.println(instance.getPublicIpAddress());
84+
}
85+
} catch (ServerException e) {
86+
e.printStackTrace();
8787
} catch (ClientException e) {
88-
e.printStackTrace();
89-
}
90-
}
91-
}
92-
```
88+
e.printStackTrace();
89+
}
90+
}
91+
}
9392

9493
## 文档
9594
* [环境要求](./docs/0-Requirements-CN.md)

docs/1-Installation-CN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[← 环境要求](0-Requirements-CN.md) | 安装[(English)](1-Installation-EN.md) | [客户端 →](2-Client-CN.md)
22
***
33

4-
无论您要使用哪个产品的开发工具包,都必须安装`SDK核心库`。比如,对云服务器SDK的调用,您需要安装`SDK核心库``云服务器`的SDK
4+
无论您要使用哪个产品的开发工具包,都必须安装`aliyun-java-sdk-core`。比如,对云服务器SDK的调用,您需要安装`aliyun-java-sdk-core``aliyun-java-sdk-ecs`
55
#### 通过Maven来管理项目依赖(推荐)
6-
如果您使用Apache Maven来管理Java项目,只需在项目的`pom.xml`文件加入相应的依赖项即可。您可以在[阿里云开发工具包](https://develop.aliyun.com/tools/sdk#/java)中下载各云产品的Maven依赖。
7-
以最新版本的SDK核心库和最新版本的Ecs SDK为例,您只需在`pom.xml`中声明这两个开发工具包,如下所示
6+
如果您使用Apache Maven来管理Java项目,只需在项目的`pom.xml`文件加入相应的依赖项即可。您可以在[阿里云开发者资源](https://help.aliyun.com/learn/developer.html)中下载各云产品的Maven依赖。
7+
以使用Ecs SDK为例,您只需在`pom.xml`中声明以下两个依赖
88
```xml
99
<dependency>
1010
<groupId>com.aliyun</groupId>

docs/1-Installation-EN.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
[← Requirements](0-Requirements-EN.md) | Installation[(中文)](1-Installation-CN.md) | [Client →](2-Client-EN.md)
22
***
33

4-
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 download the Maven dependencies of different cloud products in [Alibaba Cloud SDK](https://www.alibabacloud.com/support/developer-resources?spm=a3c0i.7911826.675768.dnavresources1.32a0737buJ2Rr4).
4+
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 download the Maven dependencies of different cloud products in [Alibaba Cloud developer resources](https://help.aliyun.com/learn/developer.html).
55

6-
You must install the Alibaba Cloud SDK for Java core library for any SDK you use. For example, to call the ECS SDK, you must install both the ECS SDK and the Alibaba Cloud SDK for Java core library.
7-
8-
For example, with SDK core library latest version and ECS SDK latest version, you need to declare the two SDKs in the pom.xml file.
6+
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.
97

8+
To use the Ecs SDK as an example, you only need to declare the following two dependencies in the `pom.xml` file:
109
```xml
1110
<dependency>
1211
<groupId>com.aliyun</groupId>
@@ -20,7 +19,7 @@ For example, with SDK core library latest version and ECS SDK latest version, yo
2019
</dependency>
2120
```
2221

23-
If maven is not downloading jar packages from a central repository, you need to add this dependency in the pom.xml file, or a NoClassDefFoundError exception will be reported
22+
If maven is not downloading jar packages from a central repository, you need to add this dependency in the `pom.xml` file, or a NoClassDefFoundError exception will be reported
2423
```xml
2524
<dependency>
2625
<groupId>com.google.code.gson</groupId>

0 commit comments

Comments
 (0)