如何在 Eclipse 中加载 Google Collections Library?

发布于 2024-10-15 04:24:48 字数 343 浏览 6 评论 0原文

我目前正在尝试学习使用 Guava,所以我通过这样做下载了源代码:

svn checkout http://guava-libraries.googlecode.com/svn/trunk/ guava-libraries-read-only

抱歉,如果这听起来真的很愚蠢,但是对于我来说,我不知道如何在 Eclipse 中加载源代码来检查它。我尝试过不同的方法(创建、导入等),但最终总是遇到包问题。

顺便说一句,我在 Ubuntu 上使用 Eclipse 3.5。

我可以得到一些帮助吗?谢谢!

编辑:我正在尝试检查源代码,因此我想将源代码添加为项目。

I'm currently trying to learn to use Guava so I downloaded the source by doing this:

svn checkout http://guava-libraries.googlecode.com/svn/trunk/ guava-libraries-read-only

Sorry if this sounds really stupid but for the life of me, I can't figure out how to load up the source in Eclipse to examine it. I've tried different ways (creating, importing, etc) but always end up with package problems.

I'm using Eclipse 3.5 on Ubuntu by the way.

Can I get some help on this? Thanks!

EDIT: I'm trying to examine the source so I would like to add the source as a project.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

冷夜 2024-10-22 04:24:49

我的回答可能有点晚了......但您也可以简单地从更新站点“番石榴捆绑";它将安装源代码,然后您只需在工作区中导入插件(文件>导入>插件和片段...不要忘记勾选第一个上的“带有源文件夹的项目”复选框该向导的页面)并从中浏览源代码。

请注意,此更新网站现已停止提供 Guava-osgi 的利润,该网站还提供一个易于安装的更新站点...但我还没有安装它,因此不知道源是否包含在通过此更新站点安装的工件中。

I might be a little late in answering ... but you could also simply install the guava bundle from the update site "guava-bundle"; it will install the sources along and you'll then just have to import the plugins in your workspace (File > Import > plugins and fragment... don't forget to tick the "projects with source folder" checkbox on the first page of this wizard) and browse the source from it.

Note that this update site has now been discontinued in profit of Guava-osgi which also provide an update site for easy installation ... but I haven't installed it yet and thus don't know whether the sources are included in the artifacts installed through this update site.

爱冒险 2024-10-22 04:24:48

这是我要做的...

  1. 转到下载页面并获取最新的捆绑版本
  2. 将其解压缩到某个本地目录
  3. 将 guava-r.jar 复制到项目的 lib 目录。
  4. 右键单击 Eclipse 中的 JAR,然后选择“添加到构建路径”。

如果您需要源代码,可以通过“配置构建路径”项目菜单或使用“附加”在 Eclipse 中附加guava-r-src.jar调试期间的源按钮。

Here is what I would do...

  1. Go to the downloads page and grab the latest bundled release
  2. Unzip it to some local directory
  3. Copy the guava-r<version>.jar to your project's lib directory.
  4. Right click on the JAR from Eclipse and say "Add to Build Path".

If you need the source you can attach the guava-r<version>-src.jar in Eclipse via the Configure Build Path project menu or by using the attach source button during debug.

网名女生简单气质 2024-10-22 04:24:48

It's easiest to download a Jar from the Guava site, copy it into your Eclipse project and add it to the build path using the jar context menu > Build Path > Add to Build Path. Also, point Eclipse to the included source zip using project context menu > Configure Build Path... to get Javadoc on the Guava classes.

千仐 2024-10-22 04:24:48

我有两种方法:SubclipseMaven Eclipse 插件。两者都提供“从存储库创建项目”之类的选项。这两个插件都有合理的在线帮助,因此我不会在这里重复具体步骤。

从存储库创建项目将为您提供源代码(以及文档、构建文件等)的完整视图。

I have done it two ways: the Subclipse and Maven eclipse plugins. Both offer "create project from repository"-like options. Both plugins have reasonable online help, so I'll not repeat exact steps here.

Creating a project from the repositories will give you a full view of the source (and documentation, build files, etc).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文