This topic describes how to install OSS SDK for Java.

Prerequisites

Use Java 1.7 or later.

You can run the java -version command to check the Java version.

Download the SDK

Install the SDK.

  • Method 1: (Recommended) Add dependencies to your Maven project

    To use OSS SDK for Java in Maven, you only need to add the corresponding dependencies to the pom.xml file. For OSS SDK for Java V3.10.2, add the following content to <dependencies>:

    <dependency>
        <groupId>com.aliyun.oss</groupId>
        <artifactId>aliyun-sdk-oss</artifactId>
        <version>3.10.2</version>
    </dependency>
  • Method 2: Import the JAR package to your Eclipse project

    For OSS SDK for Java V3.10.2, perform the following operations to import the JAR package to your Eclipse project:

    1. Download the OSS SDK for Java package.
    2. Decompress the package.
    3. Copy the aliyun-sdk-oss-3.10.2.jar file and all files in the lib folder to your project.
    4. Right-click your project name in Eclipse and choose Properties > Java Build Path > Add JARs.
    5. Select all JAR files that you have copied and import them to Libraries.
  • Method 3: Import the JAR package to IntelliJ IDEA

    For OSS SDK for Java V3.10.2, perform the following operations to import the JAR package to IntelliJ IDEA:

    1. Download the OSS SDK for Java package.
    2. Decompress the package.
    3. Copy the aliyun-sdk-oss-3.10.2.jar file and all JAR files in the lib folder to your project.
    4. In IntelliJ IDEA, select your project and choose File > Project Structure > Modules > Dependencies > + > JARs or directories.
    5. Select all JAR files that you have copied and import them to External Libraries.