eclipse import com.amazonaws 无法解析

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12165677/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:52:42  来源:igfitidea点击:

import com.amazonaws cannot be resolved

androideclipseamazon-web-services

提问by gcl1

I'm setting up an Android-based Amazon AWS SimpleDB client in Eclipse (just started). I'm getting an error on the line:

我正在 Eclipse 中设置一个基于 Android 的 Amazon AWS SimpleDB 客户端(刚刚开始)。我在线上收到一个错误:

import com.amazonaws.services.simpledb.AmazonSimpleDBClient;

that says "The import com.amazonaws cannot be resolved."

上面写着“无法解析导入的 com.amazonaws”。

I've already installed the AWS SimpleDB jar file in the lib directory of my project, and added the lib directory to the build path of my project.

我已经在我的项目的 lib 目录中安装了 AWS SimpleDB jar 文件,并将 lib 目录添加到我的项目的构建路径中。

How do I get Eclipse to resolve the name in the import statement? Thanks.

如何让 Eclipse 解析导入语句中的名称?谢谢。

回答by gcl1

I found the answer to my problem. I think I made an error when adding the lib directory to my build path.

我找到了我的问题的答案。我想我在将 lib 目录添加到我的构建路径时犯了一个错误。

Here's the right way to do it:

这是正确的方法:

Right click Project -> select Properties -> Java Build Path -> Libraries and click Add JARs. Then select the JARs added to the lib directory. Thanks.

右键单击 Project -> 选择 Properties -> Java Build Path -> Libraries 并单击 Add JARs。然后选择添加到 lib 目录的 JAR。谢谢。

回答by Christopher Leuer

I had same error today. import com.amazonaws would not resolve in Eclipse.

我今天有同样的错误。import com.amazonaws 不会在 Eclipse 中解析。

I resolved the issue by re-creating my project in Eclipse File -> New -> Other -> AWS Java Project

我通过在 Eclipse File -> New -> Other -> AWS Java Project 中重新创建我的项目解决了这个问题

I had already installed the AWS software developer kit in Eclipse.

我已经在 Eclipse 中安装了 AWS 软件开发工具包。

回答by Blehi

You can try to remove that jar from the build path and rename the "lib" directory to "libs". The jar files from the "libs" directory will be added automatically to the build path.

您可以尝试从构建路径中删除该 jar,并将“lib”目录重命名为“libs”。“libs”目录中的 jar 文件将自动添加到构建路径中。

For me the jars from the "lib" directory were not included in the apk. In the eclipse there was no problem. Only after I installed the project on a device.

对我来说,来自“lib”目录的 jars 没有包含在 apk 中。在日食中没有问题。只有在我将项目安装到设备上之后。

回答by Jay Teli

I fixed it by Installing AWS toolkit for eclipse using below steps :

我使用以下步骤通过为 Eclipse 安装 AWS 工具包来修复它:

Install the Toolkit in Eclipse 

1. Open 'Help' from Eclipse menu bar → Install New Software….

2. Enter https://aws.amazon.com/eclipse in the text box labeled “Work with” at the top of the dialog.

3. Select the required "AWS Core Management Tools" and other optional items from the list below.

4. Click “Next.” Eclipse guides you through the remaining installation steps.

After installation , Clean and rebuild the project and then restart Eclipse.

安装后,清理并重建项目,然后重新启动Eclipse。

回答by Martin R?sch

Clean Project was the solution for me.

Clean Project 是我的解决方案。