aws java 版本_java操作AWS S3一些坑记录

1,aws sdk jar版本不一致问题

一开始我在pom.xml中只配置了如下aws-java-sdk-s3

com.amazonaws

aws-java-sdk-s3

1.11.506

然后eclipse工程中如下截图,可以看到这3个jar版本不一致

8d003cea04ce0c861b0b70d48f6460a2.png

然后我直接执行下面的代码put 字符串和上传文件

1 packagecom.hp.nova.common.tasksync.awss3;2

3 importjava.io.File;4 importjava.io.IOException;5

6 importcom.amazonaws.AmazonServiceException;7 importcom.amazonaws.SdkClientException;8 importcom.amazonaws.auth.AWSCredentials;9 importcom.amazonaws.auth.AWSStaticCredentialsProvider;10 importcom.amazonaws.auth.BasicAWSCredentials;11 importcom.amazonaws.auth.profile.ProfileCredentialsProvider;12 importcom.amazonaws.services.s3.AmazonS3;13 importcom.amazonaws.services.s3.AmazonS3ClientBuilder;14 importcom.amazonaws.services.s3.model.ObjectMetadata;15 importco

你可能感兴趣的:(aws,java,版本)