[英]Import Resolve Error in Eclipse
for a little project of mine I want to read a JSON from a Webservice. 对于我的一个小项目,我想从Web服务读取JSON。 For this I want to use GSON.
为此,我想使用GSON。 My Problem is that I cannot import the dependencies into my eclipse-project.
我的问题是我无法将依赖项导入到我的eclipse-project中。 I put the jars into my classpath and they really are in the .classpath-File.
我将罐子放入我的类路径中,它们实际上位于.classpath-File中。 The strange thing is, that the eclipse autocomplete suggests me to import the GSON-FIles, but in the import section the import "com.google" cannot be resolved.
奇怪的是,日食自动完成功能提示我导入GSON-Files,但是在导入部分中,无法解析“ com.google”导入。
It looks like this: Picture of file in eclipse 它看起来像这样: 日食中的文件图片
It also does not only happen with GSON, it seems like nothing from a imported .jar can be resolved. 这不仅发生在GSON上,而且似乎无法解决导入的.jar的任何问题。
I hope one of you guys knows a solution to my problem. 我希望你们中的一个知道我的问题的解决方案。
EDIT 编辑
I figured it out myself, didn't consider the module-info java10 creates. 我自己弄清楚了,没有考虑java10创建的模块信息。 By adding
requires gson
it worked fine. 通过添加
requires gson
可以正常工作。
Right click on your project> Properties> java build path> Libraries are you able to see the required jar file if not please add via add external jars. 右键单击您的项目>属性> Java构建路径>库 ,您可以查看所需的jar文件(如果没有),请通过添加外部jar添加。 Do Project > clean
做项目>清洁
Hope this help! 希望有帮助! Let me know if you still face issues.
让我知道您是否仍然遇到问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.