mrkeyoor.com_
Mon 21 Sept 11:47 UTC
Dev Toolsevaluationupdated 26 Aug 2026

guava review

Guava is Google's collection of Java utilities for immutable collections, multimaps, multisets, graphs, hashing, concurrency, I/O, strings, and primitives. It fills gaps in the JDK with APIs that are widely reused in applications and libraries, with separate artifacts for regular JREs and Android.

+2stars / 7d
Verdict

Our Guava test run passed 4,318,381 cases but still exited 1 with 3 failures, while the separate build failed on missing snapshot test-source artifacts. That contributor friction does not erase Guava's value as a stable Maven dependency: use the correct JRE or Android artifact and prefer non-beta APIs. Skip it when the JDK already covers your needs or when exposing Guava types would impose an avoidable dependency on downstream users.

We ran it

Lab card: what happened when we ran guavaScreenshot of guava (guava.dev)
Install✓ · 48s
Build✗ · 93s
Tests✗ · 627s4318381 passed · 3 failed · 1557 skipped of 4319941 (maven surefire)
Repo3304 files~795,856 lines of source · 35.4 MB · 2 CI workflows

Answers from our run

Does guava build from source?

Dependencies installed in 48 seconds, and the build failed. We cloned commit ad1aebc into a clean Debian container with 3 CPUs and no project-specific setup.

Do guava's tests pass?

Not all of them: 4318381 of 4319941 passed and 3 failed when we ran the project's own test command (maven surefire). Some failures need services or credentials a bare container does not have.

Who should not use guava?

Libraries planning to expose Guava @Beta types publicly: the README says those APIs may change or disappear at any time.

What are the alternatives to guava?

Eclipse Collections, Apache Commons Lang, Vavr. Our Guava test run passed 4,318,381 cases but still exited 1 with 3 failures, while the separate build failed on missing snapshot test-source artifacts.

Setup3/5Easy Maven dependency, but full source build failed in our run
Docs5/5Clear artifact choice, API stability warnings, guides, and Javadoc
Community5/5August 2026 release, push, issues, and pull requests
Maturity5/5Long-lived APIs with indefinite non-beta binary compatibility

Discussed on

  1. hnThe story of Google Guava and patches87 points
  2. hnGoogle opens up more of their core Java libraries60 points
  3. hnGuava: Google core libraries for Java49 points
  4. hnForget Guava: 5 Google Libraries Java Developers Should Know8 points
  5. hnGuava: Google Core Libraries for Java8 points

Who it’s for

Java teams that repeatedly need immutable collections, multimaps, caches, hashing, or concurrency helpers.
Library authors willing to keep @Beta APIs out of their public surface.
Android developers who will select the dedicated -android artifact.
Mature JVM projects that value stable non-beta binary compatibility.

Who it’s NOT for

Libraries planning to expose Guava @Beta types publicly: the README says those APIs may change or disappear at any time.
Systems persisting Guava object serialization across upgrades: serialized forms may change unless explicitly documented otherwise.
Code that treats library classes as a boundary against hostile callers: Guava says its classes are not designed for trusted-to-untrusted communication.
Android projects using the -jre flavor instead of the dedicated -android artifact.
Contributors expecting the full source build to work offline or from only local modules: our build failed resolving snapshot test-source artifacts.

Setup reality

Our Maven install step succeeded in 48 seconds on JDK 21. The checkout held 3,304 files, about 795,856 source lines, and used 35.4 MB. Build ran for 93 seconds, then failed because the guava-gwt path could not resolve two 999.0.0-HEAD-jre-SNAPSHOT test-source artifacts.

Tests ran for 627 seconds and exited 1. Maven Surefire reported 4,318,381 passed, 3 failed, and 1,557 skipped out of 4,319,941. The supplied tail shows an aggregate module failure but does not name all 3 failing tests, so we cannot assign causes.

Consumers do not build this reactor. They choose 33.7.1-jre or 33.7.1-android from Maven Central; the current release says runtime linkage needs failureaccess 1.0.3. Contributors need the multi-module Maven snapshot flow and its test artifacts.

Guava is a broad extension to the Java standard library

Guava packages a familiar set of missing pieces for Java code: immutable collections, multimaps, multisets, graphs, hashing, string helpers, I/O utilities, primitive helpers, caches, and concurrency types. Its best APIs remove homemade utility code and give teams shared semantics. ImmutableList communicates ownership better than an unmodifiable view over a mutable list, while Multimap avoids a repeated map-of-lists pattern. The library stays close enough to ordinary Java that adoption rarely requires a new programming model.

Version 33.7.1 comes as 33.7.1-jre and 33.7.1-android. The JRE artifact supports Java 8 or newer, while Android consumers should use the separate flavor. The release notes identify one runtime linkage dependency, failureaccess 1.0.3, plus annotation-only dependencies documented by the project. Gradle users must choose whether Guava is an implementation detail or part of the library's public API by selecting implementation or api correctly.

Stable APIs exclude anything marked Beta

Guava makes an unusually strong promise for APIs without @Beta: indefinite binary compatibility, including deprecated members, subject to an emergency such as a serious security problem. The inverse is equally important. A beta class or method may change or disappear at any time. Application code can often accept that risk behind its own boundary. A published library that exposes a beta Guava type passes the risk to every consumer and can force synchronized upgrades.

The README recommends Guava Beta Checker for library authors. That is sensible because a source review can miss a beta annotation several calls deep. Serialization has a different limit: Guava says all serialized object forms may change unless a type explicitly promises otherwise. Persist business data in an owned schema rather than Java serialization of ImmutableMap or another implementation class. These warnings are not boilerplate; they define which compatibility guarantees buyers actually receive.

What happened when we ran it

Our JDK 21 sandbox completed the Maven install stage in 48 seconds. The checkout occupied 35.4 MB and contained 3,304 files with about 795,856 source lines. The build continued for 93 seconds before failing in the guava-gwt portion. Maven could not find test-source jars for guava-testlib and guava-tests at the internal-looking 999.0.0-HEAD-jre-SNAPSHOT version.

The test command ran for 627 seconds and exited 1. Maven Surefire aggregated 4,319,941 cases: 4,318,381 passed, 3 failed, and 1,557 were skipped. The tail shows the Guava unit-test module ending in failure and one sub-summary with 865,575 tests plus 1 failure. It does not include all failing class names or messages. We therefore report the three failures without guessing whether they were timing, environment, or code defects.

Those numbers reveal a source tree built around huge generated and parameterized suites. A consumer adding one artifact from Maven Central does not need to reproduce 4.3 million cases. A contributor does need the correct snapshot reactor and artifact order. The failed build suggests the generic build command in our harness did not create or locate every test-source artifact required by the GWT module. The log says what was missing, but not which project-specific command would prepare it.

The JRE and Android split is part of the API decision

Android is not a classifier to ignore. Guava maintains distinct source and artifacts for Android compatibility, while the mainline flavor is tested across OpenJDK versions on Linux and Windows. The README also warns that some I/O features may behave differently outside Linux. Teams building shared libraries should decide their lowest platform first, because publishing signatures from the JRE artifact can make an otherwise portable library unusable to Android consumers.

Release 33.7.1 arrived on August 18, 2026, and fixed a manifest regression introduced in 33.7.0 for Java 9 and 10. The repository was pushed on August 25. Recent issues and pull requests concern JDiff generation, Gradle variant selection, concurrent collection tests, and circular class initialization under GraalVM or Android tooling. The combined GitHub count was 747 issues and pull requests, which reflects the scale and age of the project rather than 747 current defects.

One open Gradle report shows Guava variant resolution failing in a non-Java project after the java-library plugin was removed. Another asks for safer initialization order around ImmutableList in GraalVM builds. These are specialized edges, but they matter because Guava is often a transitive dependency. When a build fails before application code runs, inspect the chosen flavor, Gradle attributes, and native-image metadata before blaming whichever direct dependency brought Guava in.

Use Guava deliberately, not as a default import

Guava earns its place when an API makes code clearer or removes an error-prone local implementation. It is less compelling for a lone string helper already available in the JDK, especially in a public library where every exposed type becomes a downstream commitment. Keep beta APIs private, avoid persisting Guava serialization, select the platform flavor explicitly, and let dependency management resolve failureaccess. With those rules, the mature non-beta surface is still one of the safer third-party foundations in Java.

Alternatives

ProjectWhat it isPick it when
Eclipse CollectionsA Java collections library with rich mutable and immutable types and primitive collections.pick this instead when collection APIs and primitive specialization are the main need.
Apache Commons LangFocused helpers for Java language classes, strings, numbers, objects, and reflection.pick this instead when you need common utilities without adopting Guava's collection types.
VavrPersistent collections and functional control types for Java applications.pick this instead when immutable functional programming is the design goal rather than JDK-style helpers.

What people are saying

  1. [github-trending] google/guava

Sources

  1. Guava README
  2. Guava repository
  3. Guava 33.7.1 release
  4. Gradle variant selection issue
  5. Circular class initialization issue
  6. Guava Explained

More dev tools reviews

cli · C-Plus-Plus · ish · dex · deja-vu · neomacs · the whole board →