Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse cannot find Twitter class in twitter4j

Tags:

eclipse

jar

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.

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?

like image 692
Ross Avatar asked Feb 09 '11 18:02

Ross


1 Answers

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.

like image 64
Ross Avatar answered Nov 12 '22 06:11

Ross