I installed the AWS toolkit
for java and connected it to my project in buildpath, I tried to upload file to S3
.
File fileOfImages = new File("/sdcard/Save Image Tutorial");
AmazonS3 s3client = new AmazonS3Client(new ProfileCredentialsProvider());
s3client.putObject(new PutObjectRequest("rosh-haayin-images", "images",fileOfImages));
but I get following error :
ClassNotFoundException: com.amazonaws.auth.AWSCredentialsProvider
Could someone explain why this exception occurs?
It means you are missing aws-java-sdk-1.10.X.jar in your project build path.
$ jar tvf /home/xxx/aws-java-sdk/1.10.52/lib/aws-java-sdk-1.10.52.jar |grep AWSCredentialsProvider
3485 Thu Feb 11 22:22:34 IST 2016 com/amazonaws/auth/AWSCredentialsProviderChain.class
233 Thu Feb 11 22:22:34 IST 2016 com/amazonaws/auth/AWSCredentialsProvider.class
806 Thu Feb 11 22:22:34 IST 2016 com/amazonaws/auth/DefaultAWSCredentialsProviderChain.class
verify that your project refers(Java Build Path) to the jar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With