How to Use the AWS SDK for Java V2 with Backblaze B2 Cloud Storage
  • 25 Jul 2025
  • Dark
    Light

How to Use the AWS SDK for Java V2 with Backblaze B2 Cloud Storage

  • Dark
    Light

Article summary

You can take advantage of Backblaze B2 Cloud Storage using the AWS SDK for Java V2 alongside the Backblaze S3-Compatible API.

The following example shows an account with an S3 endpoint of s3.us-west-002.backblazeb2.com:

Region region = Region.US_WEST_002;

final String END_POINT = "https://s3.us-west-002.backblazeb2.com";
AwsSessionCredentials awsCreds = AwsSessionCredentials.create(ACCESS_KEY, SECRET_ACCESS_KEY, "");

S3Client s3 = S3Client.builder().credentialsProvider(

            StaticCredentialsProvider.create(awsCreds))
.endpointOverride(URI.create(END_POINT)).region(region).build();

The S3-Compatible API allows 1000’s of integrations to natively work with Backblaze B2. If you are new to the S3-Compatible API, click here. If you have issues using this SDK with Backblaze B2, let us know by emailing us at b2feedback@backblaze.com.


Was this article helpful?