如何将 Guava 添加到我的 Eclipse 项目中?

How do I add Guava to my Eclipse project?

如何将 Guava 添加到我的 Eclipse 项目中? UseGuavaInYourBuild gives directions for Maven, Gradle, Ivy, Buildr, and manual dependencies. I don't know how to use those build systems though. Do I need to convert my project or install additional software? I have added other libraries like Apache Commons and Mockito through manual dependencies (Eclipse menu –> Preferences... –> Java –> Build Path –> User Libraries). Google says that, "You can also just manually download JARs for the classes, sources and javadocs." But the latest release (version 24.0) doesn't offer JAR files to download. I found a related Stack Overflow question,但答案似乎已过时。

您可以从索引 Maven 存储库的众多站点之一下载 jar,例如mvnrepository.com.

或者您可以克隆 Guava Github project 并从源代码构建。

但我建议您熟悉自己选择的构建系统(可能是 Maven 或 Gradle、here are some articles to help you decide)。现在是 2018 年,没有构建系统就没有人能工作。 IDE 是古怪的。可重现的构建是正确软件开发的必要条件。依赖管理是锦上添花。