Java
To get started with the Java 1.0 SDK
Once you've completed the necessary prerequisites for the Java SDK, you can get started with the Code samples.
Prerequisites
Before you get started with Java, you must do the following:
-
Follow the AWS setup instructions in Accessing Timestream for LiveAnalytics.
-
Set up a Java development environment by downloading and installing the following:
-
Java SE Development Kit 8 (such as Amazon Corretto 8).
-
Java IDE (such as Eclipse
or IntelliJ ). For more information, see Getting Started with the AWS SDK for Java
-
-
Configure your AWS credentials and Region for development:
-
Set up your AWS security credentials for use with the AWS SDK for Java.
-
Set your AWS Region to determine your default Timestream for LiveAnalytics endpoint.
-
Using Apache Maven
You can use Apache Maven
Note
To use Apache Maven, ensure your Java SDK and runtime are 1.8 or higher.
You can configure the AWS SDK as a Maven dependency as described in Using the SDK with Apache Maven.
You can run compile and run your source code with the following command:
mvn clean compile mvn exec:java -Dexec.mainClass=<your source code Main class>
Note
<your source code Main class>
is the path to your Java source code's main class.
Setting your AWS credentials
The AWS SDK for Java
The following is an example of an AWS credentials file named
~/.aws/credentials
, where the tilde character (~
)
represents your home directory.
[default] aws_access_key_id =
AWS access key ID goes here
aws_secret_access_key =Secret key goes here