Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Eclipse Helios 3.6
Windows XP SP3

I have used Eclipse to download the guava SDK by doing:
1) In Eclipse go to Help > Install New Software...
2) In the "Work with:" text box I used the following URL

http://svn.codespot.com/a/eclipselabs.org/guava-bundle/trunk/repository/

3) It found the Guava: Google Core Libraries for Java 1.5 Runtime and SDK, so I clicked ok to each message and they seemed to install fine.

Now I want to use it in my code (for an Android app) I am trying to add an import to one of my class files

import com.google.common.collect.MapMaker;

I get a compile error message

The import com.google cannot be resolved

Is there any special step I need to perform in order add the library to my project?

I have been looking through the project properties, I've got a feeling I need to add an entry to Java Build Path > Libraries but I do not know what to add.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
195 views
Welcome To Ask or Share your Answers For Others

1 Answer

As far as i know Google Guava is not an Eclipse Plugin. It's a third party library. To add a lib to the Eclipse build path simply right click on your project -> build path -> configure build path -> libraries tab -> add external jars -> locate guava-r07.jar -> OK/OPEN


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...