Install the SDK Package
Updated at:2025-10-16
Runtime environment
- Operating environment The Java SDK package can run on JDK1.7 and JDK1.8.
-
Authentication To use the Baidu AI Cloud products, you need a Baidu AI Cloud account, a valid AK (Access Key ID) and SK (Secret Access Key) for signature certification.
Plain Text1 Your AK/SK information can be obtained and understood through the following steps: 2 1. [Register a Baidu AI Cloud account](https://login.bce.baidu.com/reg.html?tpl=bceplat&from=portal) 3 4 2. [Create AK/SK](https://console.bce.baidu.com/iam/?_=1513940574695#/iam/accesslist)
Install SDK
Method I: Install with Maven
Add the bce-java-sdk dependency in your Maven pom.xml file:
Plain Text
1<dependency>
2 <groupId>com.baidubce</groupId>
3 <artifactId>bce-java-sdk</artifactId>
4 <version>{version}</version>
5</dependency>
Where, {version} is the version number, which can be found at the SDK Developer Resource Center.
Method II: Install directly with JAR packages
- Download the compressed Java SDK from the Official Website.
- After downloading, unzip
bce-java-sdk-version.zipand replicate it to the project folder. - Right-click within Eclipse and select "Project -> Properties -> Java Build Path -> Add JARs.\
-
Add the SDK toolkit
lib/bce-java-sdk-version.jarand third-party dependency toolkitsthird-party/*.jar.Where,
versionis the version number.
SDK directory structure
Plain Text
1com.baidubce
2 ├── auth //BCE signature classes
3 ├── http //BCE HTTP communication classes
4 ├── internal // SDK internal classes
5 ├── model // BCE common model classes
6 ├── services
7 │ └── blb //BLB service-related classes
8 │ ├── model //Internal BLB models, such as Request or Response
9 │ └── BlbClient.class //BLB client entry class
10 ├── util //BCE common utilities
11 ├── BceClientConfiguration.class // Configuration for BCE HttpClient
12 ├── BceClientException.class // BCE client exception class
13 ├── BceServiceException.class // Exception class after BCE server interaction
14 ├── ErrorCode.class // BCE common error codes
15 └── Region.class // Regions where BCE provides services
Uninstall SDK
To uninstall the SDK, remove the pom dependency or the source code.
