我目前使用mvn软件包在EC2实例上下载并安装了AWS sdk,所有内容似乎都正确安装。当我尝试运行DynamoDB sameple时,它失败了所有这些:
AmazonDynamoDBSample.java:18: error: package com.amazonaws does not exist
import com.amazonaws.AmazonClientException;
^
AmazonDynamoDBSample.java:19: error: package com.amazonaws does not exist
import com.amazonaws.AmazonServiceException;
^
AmazonDynamoDBSample.java:20: error: package com.amazonaws.auth does not exist
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider;
^
似乎AWS sdk没有正确安装。有什么帮助吗?
答案 0 :(得分:2)
创建一个maven项目并在pom.xml中添加以下依赖项,一切正常。
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.8.7</version>
</dependency>