User guide

AmazonEC2SpotInstances-Advanced – demonstrates persistent vs. one-time spot requests, launch
groups, and availability groups.
AmazonEC2SpotInstances-GettingStarted – demonstrates how to set up requests for Amazon EC2
Spot Instances, how to determine when they have completed, and how to clean up afterwards.
AmazonKinesis – demonstrates basic use of the Amazon Kinesis client.
AmazonKinesisApplication – makes requests to Amazon Kinesis using the Amazon Kinesis client
in the SDK for Java.
AmazonS3 – demonstrates how to make basic requests to Amazon Simple Storage Service.
AmazonS3TransferProgress – demonstrates how to track transfer progress for uploads to Amazon
S3.
AmazonSimpleEmailService – demonstrates how to send email using the Amazon Simple Email
Service JavaMail provider.
AmazonSimpleQueueService – demonstrates how to make basic requests to Amazon Simple Queue
Service.
AwsCloudFormation – demonstrates how to make basic requests to AWS CloudFormation.
AwsConsoleApp – demonstrates how to make basic requests to multiple services.
AwsFlowFramework – contains samples for the AWS Flow Framework for Java. These samples may
require additional setup. For more information about the framework and the samples that are included
in this directory, see AWS Flow Framework for Java Developer Guide
Building and Running the Samples using the
Command Line
The samples include Ant build scripts so that you can easily build and run them from the command-line.
Each sample also contains a README file in HTML format that contains information specific to each
sample.
Tip
If you are browsing the sample code on GitHub, click the Raw button in the source code display
when viewing the README.html file for a sample. In raw mode, the HTML will render as intended
in your browser.
Prerequisites
Before running any of the AWS SDK for Java samples, you will need to set your AWS credentials in the
environment or with the AWS CLI as specified in Set up your AWS Credentials for Use with the SDK for
Java (p. 6). The samples use the default credential provider chain whenever possible, so by setting your
credentials this way, you can avoid the risky practice of inserting your AWS credentials in files within the
source code directory (where they may inadvertently be checked in and shared publicly).
To run a sample from the command line:
1. Change to the directory containing the sample's code. For example, if you are in the root directory
of the AWS SDK download and want to run the AwsConsoleApp sample, you would type:
cd samples/AwsConsoleApp
2. Build and run the sample with Ant. The default build target performs both actions, so you can just
enter:
Version v1.0.0
67
AWS SDK for Java Developer Guide
Building and Running the Samples using the Command
Line