Installing the Java SDK

Java SDK can be installed by importing Java SDK JAR file, adding Maven dependency, or downloading Java SDK from HUAWEI CLOUD mirror center.

Method 1: Importing Java SDK JAR File

You can download the JAR file from the GitHub website and import the package to the interactive development environment (IDE).

https://github.com/huaweicloud/huaweicloud-sdk-release/tree/master/java-sdk

Take Eclipse as an example. After creating a Java project, perform the following steps to import the JAR file to the new project:
  1. Copy the downloaded JAR file to the project folder.
  2. Open the project in Eclipse, right-click the project, and choose Properties.
  3. In the displayed dialog box, click Java Build Path. On the Libraries tab, click Add JARs to add the downloaded JAR file.
  4. Click OK.

Method 2: Adding Maven Dependency

Add the following dependency to the pom.xml file to install the Java SDK:

<dependency>
<groupId>com.huawei</groupId>
<artifactId>openstack4j</artifactId>
<version>1.0.12</version>
</dependency>

For the latest version supported by Java SDK, see here.

Method 3: Downloading Java SDK from HUAWEI CLOUD Mirror Center

  1. Find the global configuration file settings.xml of Maven. Generally, the file is located in conf of the Maven installation directory. For example, in Windows, you can locate the configuration file in D:\maven\apache-maven-3.3.9\conf\settings.xml.
  2. Locate mirror in settings.xml and add the following configurations:
<mirror>
    <id>huaweicloud</id>
    <mirrorOf>*,!HuaweiCloudSDK</mirrorOf>
    <url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>
  1. Open the pom.xml file of the Maven project and add the following configuration to the <dependency> node:
<dependency>
    <groupId>com.huawei</groupId>
    <artifactId>openstack4j</artifactId>
   <version>1.0.12</version>
</dependency>

For the latest version supported by Java SDK, see here.