The AWS IoT Device SDK for Java v2 connects your Java applications and devices to the AWS IoT platform. It handles the complexities of secure communication, authentication, and device management so you can focus on your IoT solution. The SDK makes it easy to use AWS IoT services like Device Shadows, Jobs, Fleet Provisioning, and Commands.
Supported Platforms: Linux, Windows 11+, macOS 14+, Android API level 24+ (Android 7.0+)
Note: The SDK is known to work on older platform versions, but we only guarantee compatibility for the platforms listed above.
Topics:
The primary purpose of the AWS IoT Device SDK for Java v2 is to simplify the process of connecting devices to AWS IoT Core and interacting with AWS IoT services on various platforms. The SDK provides:
- Integrated service clients for AWS IoT Core services
- Secure device connections to AWS IoT Core using MQTT protocol including MQTT 5.0
- Support for multiple authentication methods and connection types
- Android support
- The AWS IoT Device Shadow service manages device state information in the cloud.
- The AWS IoT Jobs service sends remote operations to connected devices.
- The AWS IoT fleet provisioning service generates and delivers device certificates automatically.
- The AWS IoT Device Management commands service sends instructions from the cloud to connected devices.
The recommended way to use the AWS IoT Device SDK for Java v2 in your project is to consume it from Maven Central.
To develop applications that use AWS IoT Device SDK for Java v2, you need:
- Java 8+ (Download and Install Java)
- Java JDK 8+ (Download and Install JDK)
- A build tool such as Maven
See detailed setup instructions for more information.
Add the following to your pom.xml
dependencies:
<dependency>
<groupId>software.amazon.awssdk.iotdevicesdk</groupId>
<artifactId>aws-iot-device-sdk</artifactId>
<version>1.27.4</version>
</dependency>
Replace 1.27.4
in <version>1.27.4</version>
with the latest release version for the SDK.
Look up the latest SDK version here: https://github.com/aws/aws-iot-device-sdk-java-v2/releases
See the Development Guide for detailed instructions on building from source and using local builds.
To get started with the AWS IoT Device SDK for Java v2:
-
Add the SDK to your project - See the Installation section for Maven dependency details
-
Choose your connection method - The SDK supports multiple authentication methods including X.509 certificates, AWS credentials, and custom authentication. MQTT5 User Guide connection section and MQTT5 X509 sample provide more guidance
-
Follow a complete example - Check out the samples directory
-
Learn MQTT5 features - For advanced usage and configuration options, see the MQTT5 User Guide
Check out the samples directory for working code examples that demonstrate:
- Basic MQTT connection and messaging
- AWS IoT Device Shadow operations
- AWS IoT Jobs
- AWS IoT Fleet provisioning: basic and with CSR
- AWS IoT Commands
The samples provide ready-to-run code with detailed setup instructions for each authentication method and use case.
The best way to interact with our team is through GitHub.
- Open discussion: Share ideas and solutions with the SDK community
- Search issues: Find created issues for answers based on a topic
- Create an issue: New feature request or file a bug
If you have a support plan with AWS Support, you can also create a new support case.
Note
This SDK does not support TLS 1.3 on macOS. Support for TLS 1.3 on macOS is planned for a future release.
Please note that on Mac, once a private key is used with a certificate, that certificate-key pair is imported into the Mac Keychain. All subsequent uses of that certificate will use the stored private key and ignore anything passed in programmatically. Beginning in v1.7.3, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
static: certificate has an existing certificate-key pair that was previously imported into the Keychain.
Using key from Keychain instead of the one provided.
Check out our resources for additional guidance too before opening an issue:
- FAQ
- AWS IoT Core Developer Guide
- MQTT5 User Guide
- API Docs
- AWS IoT Core Documentation
- Dev Blog
- Migration Guide from the AWS IoT SDK for Java v1
- Contributions Guidelines
- DEVELOPING
This library is licensed under the Apache 2.0 License.
Latest released version: v1.27.4