Install SDK
Updated at:2025-10-27
Environment preparation
- Operating environment
The Java SDK package can run on JDK1.7 and JDK1.8. -
Authentication and certification
To use the Baidu AI Cloud product, 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](Reference/Retrieve AK and SK/How to Obtain AKSK.md)
Download and installation
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 class
3 ├── http //BCE HTTP communication class
4 ├── internal //SDK internal class
5 ├── model //BCE common model class
6 ├── services
7 │ └── billing //Classes related to the billing service
8 │ ├── example //Example code for using the billing API
9 │ ├── model //Billing related models, such as Request or Response
10 │ └── BillingClient.class //Entry class for the billing client
11 ├── util //BCE common utilities
12 ├── BceClientConfiguration.class //Configuration for BCE HttpClient
13 ├── BceClientException.class //BCE client exception class
14 ├── BceServiceException.class // Exception class after BCE server interaction
15 ├── ErrorCode.class // BCE common error codes
16 └── Region.class // Regions where BCE provides services
Uninstall SDK To uninstall the SDK, simply remove the pom dependency or source code.
