@Override
    public AWSCredentials getCredentials() {
        String accessKey = StringUtils.trim(System.getProperty(ACCESS_KEY_SYSTEM_PROPERTY));
        String secretKey = StringUtils.trim(System.getProperty(SECRET_KEY_SYSTEM_PROPERTY));
        String sessionToken = StringUtils.trim(System.getProperty(SESSION_TOKEN_SYSTEM_PROPERTY));
        String accountId = StringUtils.trim(System.getProperty(AWS_ACCOUNT_ID_SYSTEM_PROPERTY));

        if (StringUtils.isNullOrEmpty(accessKey) || StringUtils.isNullOrEmpty(secretKey)) {
            throw new SdkClientException(
                    "Unable to load AWS credentials from Java system "
                    + "properties (" + ACCESS_KEY_SYSTEM_PROPERTY + " and "
                    + SECRET_KEY_SYSTEM_PROPERTY + ")");
        }
        if (StringUtils.isNullOrEmpty(sessionToken)) {
            return new BasicAWSCredentials(accessKey, secretKey, accountId, PROVIDER_NAME);
        } else {
            return new BasicSessionCredentials(accessKey, secretKey, sessionToken, accountId, PROVIDER_NAME);
        }
    }
{@link AWSCredentialsProvider} implementation that provides credentials by
looking at the <code>aws.accessKeyId</code> and <code>aws.secretKey</code>
Java system properties.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/SystemPropertiesCredentialsProvider.java