如何添加Guava到Eclipse项目 [英] How to add Guava to Eclipse project

查看:323
本文介绍了如何添加Guava到Eclipse项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse Helios 3.6

Windows XP SP3

Eclipse Helios 3.6
Windows XP SP3

我已经使用Eclipse通过执行下载番石榴SDK:

1)在Eclipse中,转到帮助>安装新软件...

2)在使用:文本框中使用以下URL

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)它发现了Guava:Google Core Library for Java 1.5 Runtime和SDK,所以我点击了确定每个消息,他们似乎安装正常。



现在我想在我的代码中使用它(对于Android应用程序)我正在尝试将一个导入添加到我的一个类文件中

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


import com.google不能
解决

The import com.google cannot be resolved

有没有什么特别的一步我需要执行以便将库添加到我的项目中?



我一直在浏览项目属性,我有一种感觉,我需要添加一个条目到Java构建路径>库中但是我不知道该添加什么。

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.

推荐答案

据我所知 Google Guava 不是Eclipse插件。这是第三方图书馆。
要将一个lib添加到Eclipse构建路径,只需右键单击您的项目 - >构建路径 - >配置构建路径 - >库选项卡 - >添加外部jar - > locate guava-r07.jar - > OK / OPEN

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

这篇关于如何添加Guava到Eclipse项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆