Java 8 shipped lambdas in 2014 and then quietly stopped. There are still no immutable collections in the JDK, no tuples, no Either, and no ergonomic way to call a method that throws a checked exception from inside a map(). Sixteen years later, most Java teams still write if (x != null) chains and wrap every repository call in a six-line try/catch.
Three libraries exist to close that gap: Vavr, jOOλ, and Functional Java. In 2026 they are in very different states — one is actively maintained with fresh releases, one is a thin stream extension that keeps earning its keep, and one has not shipped a release in nearly four years. Picking the wrong one costs you a rewrite, because these libraries are not drop-in replacements for each other.
TL;DR
- Start new code with Vavr 1.1.0. It is the only one of the three with immutable collections, tuples,
Option,Try,Either, and a release in the last two months. - Use jOOλ 0.9.16 if your code is already
Stream-shaped and you want tuples plus checked-exception helpers without adopting a second collection hierarchy. - Do not start new code on Functional Java. Version 5.0 shipped in February 2022 and the repository has been quiet since April 2023. It is fine to keep, expensive to adopt.
| Dimension | Vavr | jOOλ | Functional Java |
|---|---|---|---|
| GitHub stars | 6,180 | 2,120 | 1,619 |
| Latest release | 1.1.0 (Oct 2026) | 0.9.16 (Oct 2026) | 5.0 (Feb 2022) |
| Last commit | Nov 2026 | Nov 2026 | Apr 2023 |
| Core idea | Persistent collections + control types | Extension of java.util.stream | Full FP prelude for the JVM |
| Immutable collections | Yes, first-class | No (wraps JDK streams) | Yes (fj.data.List, Stream) |
| Tuples | Up to Tuple8 | Up to Tuple16 | P2–P8 products |
| Checked-exception helpers | Try, CheckedFunction | Unchecked, Checked* | Try-free; uses fj.control |
| Interop cost | Conversion at the boundary | Near zero — it is a stream | High — its own type classes |
| Best fit | New services, domain modeling | Existing stream pipelines | Legacy codebases already using it |
Decision Matrix: Pick in Ten Seconds
| Your situation | Choose | Why |
|---|---|---|
| Greenfield service, domain objects with optional fields | Vavr | Option/Either replace null checks and exception-driven flow |
Existing Stream code that needs zipping and tuples | jOOλ | Seq wraps a Stream; you convert nothing |
You need Tuple16 or checked-exception lambdas right now | jOOλ | Widest tuple arity and the cleanest Unchecked helpers |
Codebase already imports fj.data.* | Functional Java | Migration cost exceeds any benefit; freeze and contain it |
You want zero new dependency and only need Optional | None of them | Optional + List.copyOf covers the basics |
| Team is on Java 21+ and uses records heavily | Vavr | Pattern matching plus Option composes cleanly with records |
Vavr 1.1.0 — The Default Choice
Vavr (formerly Javaslang) is the most complete of the three. It gives you a persistent collection hierarchy (List, Vector, Map, Set, Queue, Stream) plus four control types that cover almost every awkward control-flow case in business code: Option, Try, Either, and Validation.
The collections are persistent and structurally shared, which means “modifying” a list returns a new list while reusing most of the old structure. Appends on Vector are effectively constant time; List prepends are constant time. The trade-off is allocation: every transformation produces a new object graph, so tight numeric loops belong in plain arrays, not in io.vavr.collection.List.
| |
Add it with a single dependency. If you use pattern matching on Vavr types, pull in vavr-match as well:
| |
Version warning: the 1.x line is not binary compatible with 0.10.x. Deprecated members that survived for years were removed. Budget a recompile of every module that touches Vavr, then run your test suite before you touch production. Teams that jumped from 0.10.4 to 1.x without reading the changelog spent a day chasing NoSuchMethodError at runtime.
Where Vavr struggles is boundaries. Spring’s Optional, Jackson’s deserializers, and every JDBC library speak JDK types. You will write option.toJavaOptional() and Option.ofOptional(...) at the edges, and that friction is real. Keep the conversion in your adapter layer, not sprinkled through services.
jOOλ 0.9.16 — The Stream Extension That Refuses to Be a Framework
jOOλ (pronounced “jewel”) takes the opposite bet. Instead of shipping a new collection hierarchy, it wraps java.util.stream.Stream in a type called Seq and adds exactly what the JDK left out: tuples, zip, zipWithIndex, crossJoin, window functions, and unchecked functional interfaces.
Because Seq is a thin wrapper, the interop cost is close to zero. There is no impedance mismatch, no adapter layer, and no second definition of “list” in your codebase. That is why jOOλ survives in shops that rejected Vavr on principle.
| |
Dependency coordinates, current release 0.9.16:
| |
The catch is that jOOλ does not solve null handling or immutability. You still get NullPointerException from a missing field, and you still get mutable ArrayList when you call collect(Collectors.toList()). jOOλ makes stream code shorter, not safer. If your motivation is eliminating null checks, it is the wrong tool.
There is also a subtle trap with Unchecked: it wraps the checked exception in a RuntimeException. If the surrounding framework only inspects the top-level exception type — several retry and transaction managers do — your IOException will look like a generic runtime failure. Unwrap it explicitly in the handler.
Functional Java 5.0 — Respectable, But Frozen
Functional Java is the oldest of the three and the most theoretically complete. It ships its own F and F2 function types (predating java.util.function), algebraic data types in fj.data, and a prelude of higher-order helpers. In 2012 it was genuinely ahead of the JDK. In 2026 it is a maintenance liability.
| |
Two things make adoption expensive. First, its function types are not java.util.function types, so every method reference needs an adapter. Second, its collections do not implement java.util.Collection, which means Jackson, Bean Validation, and most mapping libraries need custom serializers.
Version 5.0 was published in February 2022; the repository’s last push was April 2023. It has not been abandoned in the sense of being deleted, but it is not receiving fixes. If you inherit a codebase that uses it, contain it: wrap it behind your own interfaces, do not let fj.data.List appear in public method signatures, and do not add new modules onto it.
The Real Decision: Allocation, Interop, and Team Cost
Performance discussions around these libraries usually miss the point. All three are fast enough for business logic. The differences that actually bite are:
- Allocation pressure. Vavr and Functional Java allocate a new structure per transformation. In a loop processing a million rows, that is a million short-lived object graphs. jOOλ inherits the JDK’s stream behavior, including lazy evaluation and short-circuiting, so it behaves like the code your team already knows.
- Boundary friction. Vavr needs
.toJavaOptional()/.toJavaList()at framework edges. Functional Java needs full adapters. jOOλ needs nothing. - Onboarding. A developer who knows
Streamcan read jOOλ in an hour. Reading Vavr’sValidationandEithercorrectly takes a week of practice, mostly to stop reaching for exceptions. - Durability. Only two of the three shipped a release in the last quarter. A library that has not released since 2022 will eventually fail a JDK upgrade in a way nobody upstream will fix.
A pragmatic combination that several teams converge on: Vavr for the domain layer, jOOλ for stream-heavy data munging, and no Functional Java. The two coexist without conflict because their types never meet — you keep them in separate packages and convert at the seam.
Pitfalls Worth Knowing Before You Commit
- Do not mix
io.vavr.collection.Listwithjava.util.Listin the same API. Pick one per module. Half-migrated modules produce the worst of both: conversion noise plus duplicate imports. Tryis not a substitute for transactions. Catching aTry.Failureafter a database write does not roll anything back. Keep transactional boundaries in the service layer, and useTryonly to make failure composable.Eitherleft types drift. Without a sealed error hierarchy, you end up withEither<String, T>andEither<Exception, T>in the same codebase. Define one error type and stick to it.- Jackson needs modules. Vavr types are not JavaBean-shaped. Register
jackson-datatype-vavror yourOptionfields will serialize as{}. - Watch the lambda capture in
Unchecked. It erases the checked type, so acatch (IOException e)around the call site will not compile — the compiler no longer sees a checked exception there. - Benchmarks from 2016 are worthless. If a comparison table quotes nanosecond numbers without a JDK version, ignore it and measure your own hot path with JMH.
Interop With Modern Java
Records and sealed interfaces, both stable since Java 17, change the calculus slightly. A record with an Option field is a clean way to model “this value may be absent” without nulling out a reference. Pattern matching over a sealed hierarchy plus Either gives you exhaustive handling the compiler can check — something none of these libraries could offer on Java 8.
What the JDK still has not delivered is a persistent collection library. List.copyOf gives you an immutable copy, not structural sharing; copying a 100,000-element list on every update is not a strategy. That gap is exactly why Vavr remains relevant in 2026 and why “just use the JDK” is not yet a complete answer.
FAQ
Is Vavr still worth using in 2026?
Yes, if you write business logic with optional values, fallible operations, or immutable data structures. Vavr 1.1.0 shipped in October 2026 and the project is actively maintained. If your code is pure stream processing with no null-handling problem, jOOλ or plain Stream is a lighter answer.
Can I use Vavr and jOOλ in the same project?
Yes. They do not share types, so there is no classpath conflict beyond two small jars. Keep them in separate packages and convert at one seam — typically a mapper class — rather than letting both appear in the same method signature.
Is Functional Java dead?
It is dormant rather than formally dead. The last release was 5.0 in February 2022 and the last commit was April 2023. It still works on current JDKs, but it will not receive fixes for future JDK changes. Do not start new code on it; contain existing usage behind your own interfaces.
Does jOOλ replace Vavr’s Option type?
No. jOOλ gives you tuples, Seq, and Unchecked, but it does not provide a null-safe optional type or immutable collections. If you need those, you need Vavr or a hand-rolled Optional-based approach. jOOλ is an ergonomics layer over streams, not a safety layer.
Which library has the smallest runtime footprint?
jOOλ, by a wide margin in practice, because it adds wrapper types over the JDK rather than a full collection hierarchy. Vavr is larger but still measured in hundreds of kilobytes. Functional Java’s size is comparable to Vavr. For a CLI tool where startup time matters, prefer jOOλ or no library at all.
Do these libraries work with virtual threads and structured concurrency?
Yes, with one caveat: all three predate the structured-concurrency APIs, so none of them propagate cancellation or scope automatically. Vavr’s Try and jOOλ’s Unchecked will happily swallow an InterruptedException wrapped in a runtime exception, which breaks cooperative cancellation. Re-throw interrupts explicitly in any pipeline that runs on a carrier thread.
Related Reading
If your team is standardizing a JVM stack, these comparisons cover the adjacent decisions: Java collections libraries — Eclipse Collections vs Fastutil vs HPPC for the mutable, primitive-specialized side of the same problem; Java database access libraries — JDBI3 vs MyBatis vs jOOQ for where Either and Try actually show up in production; and Java serialization libraries — Kryo vs Protobuf vs Avro if your immutable domain objects need to cross a wire.
💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com