Using the AWS SDK for Java (v2) with B2


The AWS SDK for Java can be leveraged for use with Backblaze B2 S3 Compatible API by a few small configuration changes. Here is an example of doing so for an account with an S3 Endpoint of


Region region = Region.US_WEST_002;

final String END_POINT = "";
AwsSessionCredentials awsCreds = AwsSessionCredentials.create(ACCESS_KEY, SECRET_ACCESS_KEY, "");

S3Client s3 = S3Client.builder().credentialsProvider(



The S3 Compatible API for Backblaze B2 Cloud Storage allows 1000’s of integrations to work with B2 natively. If you’re new to the S3 Compatible API, please see our Getting Started Guide. If you have any trouble using the AWS SDK for Java (v2)  with B2, please let us know by emailing us at

Have more questions? Submit a request


Article is closed for comments.
Powered by Zendesk