This topic uses aliyun-java-sdk-green 3.5.1 as an example to describe how to install the Java SDK.

Prerequisites

Java 1.6 or later is installed.
Note You can run the java -version command to check the Java version.

Install the SDK

If you use the aliyun-java-sdk-green Java SDK in Maven, you only need to add relevant dependencies to the pom.xml file. For example, if you use aliyun-java-sdk-green 3.5.1, add the following content to <dependencies>:
<dependency>
          <groupId>com.aliyun</groupId>
          <artifactId>aliyun-java-sdk-core</artifactId>
          <version>4.1.1</version>
      </dependency>
    <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-green</artifactId>
            <version>3.5.1</version>
        </dependency>
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
        <version>1.2.51</version>
    </dependency>
    <dependency>
        <groupId>com.aliyun.oss</groupId>
        <artifactId>aliyun-sdk-oss</artifactId>
        <version>2.8.3</version>
    </dependency>
Some of the Java sample code is compiled based on Java helper dependencies to read files and convert strings. You can add the following content to <dependencies> as needed:
<dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.10</version>
        </dependency>