IntelliJ无法解析com.amazonaws符号
这可能是一个非常简单的问题,但是我已经坚持了好几个小时...
this may be a very simple question, but I've been stuck on it for hours...
我正在尝试将亚马逊云集成添加到我的项目中,但似乎无法使该项目识别jar文件.我目前只是在尝试实例化AmazonS3客户端:
I'm trying to add amazon cloud integrations into my project, and I can't seem to get the project to recognize the jar files. I'm currently simply trying to instantiate an AmazonS3 client:
AmazonS3 s3 = new AmazonS3Client();
我已将其添加到我的build.gradle的依赖项下{}:
I've added this to my build.gradle under dependencies{ }:
compile('com.amazonaws:aws-java-sdk:1.10.6')
当我运行gradle build时,看起来好像是从maven下载一堆jar文件,但是当我去编译我的项目时,出现找不到符号"错误.
When I run gradle build, it looks like it is downloading a bunch of jar files from maven, but when I go to compile my project, I get "symbol not found" errors.
error: cannot find symbol
AmazonS3 s3 = new AmazonS3Client();
^
似乎gradle没有将类添加到我的类路径中.我需要一些插件吗?我需要手动将罐子添加到我的项目中吗?
It seems like gradle isn't adding the classes to my classpath or something. Is there some plugin I need? Do I need to add the jars manually to my project?
谢谢
我正在使用IntelliJ Idea管理项目.
I'm using IntelliJ Idea to manage the project.
不完全确定问题出在哪里,但是我可以通过以下方式解决问题:
Not entirely sure what the problem was before, but I was able to resolve it by:
gradle clean
gradle cleanIdea
gradle idea
...
<import required classes>
...
gradle build
似乎这样解决了.项目设置有问题.
Seems like this resolved it. Something was wrong with the project setup.