SDK Download and Installation (SDK for Java)
Downloading OBS SDK for Java
Installing OBS SDK for Java
Table 1 lists the supported methods of installing SDK for Java.
| No. | Method |
|---|---|
| 1 | Method 1: Using the Maven Central Repository and Maven Project |
| 2 | Method 2: Using the Gradle Central Repository and Gradle Project |
Method 1: Using the Maven Central Repository and Maven Project
Before using this method, ensure that the Java and Maven environments are correctly configured and can be used properly.
- Access the Maven central repository to obtain the version number of OBS SDK for Java. You can either choose an OBS Bundle SDK for Java or a standard OBS SDK for Java. No matter Bundle or standard SDKs, the latest version is recommended. Bundle SDK 3.23.9 is used here.
- Bundle SDKs share the same source code as standard SDKs. The difference is that in Bundle SDKs, all third-party dependencies are organized into the SDK and are added from the SDK path. This means Bundle SDKs are freed from potential external dependency conflicts but require a larger space (over 7 MB).
- If there is a dependency conflict when you use a standard SDK, resolve the issue by referring to Resolving Dependency Missing or Conflicts (SDK for Java).
- Open the pom.xml file of the Maven project and add dependency configurations to <dependencies>.
If you choose to use a Bundle SDK, add the following configuration to <dependencies> and replace bundleVersionNumber with the SDK version number obtained in 1:
1 2 3 4 5
<dependency> <groupId>com.huaweicloud</groupId> <artifactId>esdk-obs-java-bundle</artifactId> <version>bundleVersionNumber</version> </dependency>
If you choose to use Bundle SDK 3.23.9, add the following configuration to your pom.xml file:
1 2 3 4 5
<dependency> <groupId>com.huaweicloud</groupId> <artifactId>esdk-obs-java-bundle</artifactId> <version>3.23.9</version> </dependency>
If you choose to use a standard SDK, add the following configuration to <dependencies> and replace VersionNumber with the SDK version number obtained in 1:
1 2 3 4 5
<dependency> <groupId>com.huaweicloud</groupId> <artifactId>esdk-obs-java</artifactId> <version>versionNumber</version> </dependency>
- Click Reload All Maven Projects to refresh the Maven configuration.
- Check whether the SDK is successfully installed. If a JAR package for Java SDK is downloaded to the dependency path, the SDK is installed. If no JAR package is generated, check whether the pom.xml file is correctly configured and the version number of SDK is correctly replaced. If the fault persists, submit a service ticket.

Method 2: Using the Gradle Central Repository and Gradle Project
Before using this method, ensure that the Java and Gradle environments are correctly configured and can be used properly.
- Obtain the version number of OBS SDK for Java. You can either choose an OBS Bundle SDK for Java or a standard OBS SDK for Java. No matter Bundle or standard SDKs, the latest version is recommended. Bundle 3.23.9 is used here.
- Bundle SDKs share the same source code as standard SDKs. The difference is that in Bundle SDKs, all third-party dependencies are organized into the SDK and are added from the SDK path. This means Bundle SDKs are freed from potential external dependency conflicts but require a larger space (over 7 MB).
- If there is a dependency conflict when you use a standard SDK, resolve the issue by referring to Resolving Dependency Missing or Conflicts (SDK for Java).
- Open the build.gradle file of the Gradle project and add the dependency configurations to dependencies.
If you choose to use a Bundle SDK, add the following configuration to <dependencies> and replace bundleVersionNumber with the SDK version number obtained in 1:
1api 'com.huaweicloud:esdk-obs-java-bundle:bundleVersionNumber'
If you choose to use Bundle SDK 3.23.9, add the following configuration to your build.gradle file:
1api 'com.huaweicloud:esdk-obs-java-bundle:3.23.9'
If you choose to use a standard SDK, add the following configurations to dependencies and replace VersionNumber with the SDK version number obtained in 1:
1api 'com.huaweicloud:esdk-obs-java:versionNumber'
- Click Reload All Gradle Projects to refresh the Gradle configuration.
- Check whether the SDK is successfully installed. If a JAR package for Java SDK is downloaded to the dependency path, the SDK is installed. If no JAR package is generated, check whether the build.gradle file is correctly configured and the version number of SDK is correctly replaced. If the fault persists, submit a service ticket.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot