Java examples
The Alibaba Cloud Java software development kit (SDK) for Elastic Accelerated Computing Instances (EAIS) lets you access the EAIS service without complex programming. This topic describes how to use the EAIS Java SDK and the Alibaba Cloud core library.
Prerequisites
Before you call an API, you must create an AccessKey. For more information, see Create an AccessKey.
An AccessKey for an Alibaba Cloud account has access permissions for all APIs. For security purposes, use a Resource Access Management (RAM) user for API calls or daily O&M. Do not save your AccessKey ID and AccessKey secret in your project code because this can lead to an AccessKey leak and compromise the security of all resources in your account. This example uses the Alibaba Cloud Credentials tool to manage the AccessKey for identity verification when making API calls. For more information, see Manage access credentials. You can also set the Alibaba Cloud AccessKey in the environment variables of your Linux, macOS, or Windows operating system for identity verification. For more information, see Configure environment variables on Linux, macOS, and Windows systems.
Install the Java SDK
You can install the Java SDK in one of the following ways.
(Recommended) Add the Java SDK using the Maven coordinate. Add the following dependency to your
pom.xmlfile.<dependency> <groupId>com.aliyun</groupId> <artifactId>eais20190624</artifactId> <version>2.1.1</version> </dependency>Go to the Maven page for the Java SDK (Maven Central Repository Search) and download the package.