本文介绍了Eclipse在twitter4j中找不到Twitter类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是twitter4j 2.1.11 jar,但Eclipse似乎无法在其中查找类。我添加了jar作为引用库,但是当尝试使用它时,得到 Twitter无法解析为类型。我可以添加导入,如 import twitter4j。​​ 而不是 import twitter4j.Twitter

I'm using the twitter4j 2.1.11 jar, but Eclipse doesn't seem to be able to find classes within it. I added the jar as a referenced library, but get Twitter cannot be resolved to a type when trying to use it. I can add imports like import twitter4j.* but not import twitter4j.Twitter.

当我在档案查看器中打开jar时,我可以告诉该类是否可用。我如何让Eclipse行为?

I can tell the class is available as it is present when I open the jar in an archive viewer. How can I get Eclipse to behave?

推荐答案

我遇到的问题是我导入错误的存档,存档,而不是在twitter4j下载的/ lib中找到的。

The problem I was having was that I was importing the wrong archive, specifically the sources archive rather than the one found in /lib of the twitter4j download.

这篇关于Eclipse在twitter4j中找不到Twitter类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 16:48