AWS SDK for Java
Developer Guide

Set Up the AWS SDK for Java 2.0 Developer Preview

This topic describes how to set up and use the AWS SDK for Java in your project.

Prerequisites

To use the AWS SDK for Java, you must have:

Including the SDK in Your Project

Depending on your build system or IDE, use one of the following methods:

  • Apache Maven– If you use Apache Maven, you can specify only the SDK components you need or the entire SDK (not recommended) as dependencies in your project. See Using the SDK with Apache Maven.

  • Gradle– If you use Gradle, you can import the Maven Bill of Materials (BOM) to your Gradle project to automatically manage SDK dependencies. See Using the SDK with Gradle.

Note

Any build system that supports MavenCentral as an artifact source may be used. However we will not provide a downloadable zip for the developer preview.

Compiling the SDK

You can build the AWS SDK for Java using Maven. Maven downloads all necessary dependencies, builds the SDK, and installs the SDK in one step. See http://maven.apache.org/ for installation instructions and more information.

To compile the SDK

  1. Open AWS SDK for Java 2.0 (GitHub).

    Note

    Version 1.0 of the SDK is also available in GitHub at AWS SDK for Java 1.x (GitHub).

  2. Click the Clone or download button to choose your download option.

  3. In a terminal window, navigate to the directory where you downloaded the SDK source.

  4. Build and install the SDK by using the following command (Maven required).

    mvn clean install

    The resulting .jar file is built into the target directory.

  5. (Optional) Build the API Reference documentation using the following command.

    mvn javadoc:javadoc

    The documentation is built into the target/site/apidocs/ directories of each service.

Installing a Java Development Environment

The AWS SDK for Java requires Java SE Development Kit 8.0 or later. You can download the latest Java software from http://www.oracle.com/technetwork/java/javase/downloads/.

Choosing a JVM

For the best performance of your server-based applications with the AWS SDK for Java, we recommend that you use the 64-bit version of the Java Virtual Machine (JVM). This JVM runs only in server mode, even if you specify the -Client option at run time.