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.
DimensionVavrjOOλFunctional Java
GitHub stars6,1802,1201,619
Latest release1.1.0 (Oct 2026)0.9.16 (Oct 2026)5.0 (Feb 2022)
Last commitNov 2026Nov 2026Apr 2023
Core ideaPersistent collections + control typesExtension of java.util.streamFull FP prelude for the JVM
Immutable collectionsYes, first-classNo (wraps JDK streams)Yes (fj.data.List, Stream)
TuplesUp to Tuple8Up to Tuple16P2–P8 products
Checked-exception helpersTry, CheckedFunctionUnchecked, Checked*Try-free; uses fj.control
Interop costConversion at the boundaryNear zero — it is a streamHigh — its own type classes
Best fitNew services, domain modelingExisting stream pipelinesLegacy codebases already using it

Decision Matrix: Pick in Ten Seconds

Your situationChooseWhy
Greenfield service, domain objects with optional fieldsVavrOption/Either replace null checks and exception-driven flow
Existing Stream code that needs zipping and tuplesjOOλSeq wraps a Stream; you convert nothing
You need Tuple16 or checked-exception lambdas right nowjOOλWidest tuple arity and the cleanest Unchecked helpers
Codebase already imports fj.data.*Functional JavaMigration cost exceeds any benefit; freeze and contain it
You want zero new dependency and only need OptionalNone of themOptional + List.copyOf covers the basics
Team is on Java 21+ and uses records heavilyVavrPattern 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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import io.vavr.collection.List;
import io.vavr.control.Either;
import io.vavr.control.Option;
import io.vavr.control.Try;

record Address(String city) {}
record User(String name, Address address) {}

// Null-safe navigation without a single if-block
Option<String> city = Option.of(user)
    .map(User::address)
    .map(Address::city)
    .filter(c -> !c.isBlank());

// Exceptions become values, so they compose inside pipelines
Try<Integer> port = Try.of(() -> Integer.parseInt(System.getenv("PORT")))
    .recover(NumberFormatException.class, 8080);

// Two-track error handling with a typed left side
Either<String, Integer> parsed = Try.of(() -> Integer.parseInt(input))
    .toEither("not a number: " + input);

// Persistent collections: map/filter return new values, originals are untouched
List<Integer> doubled = List.of(1, 2, 3, 4)
    .filter(i -> i % 2 == 0)
    .map(i -> i * 2);

System.out.println(doubled.mkString(", ")); // 4, 8

Add it with a single dependency. If you use pattern matching on Vavr types, pull in vavr-match as well:

1
2
3
4
5
<dependency>
  <groupId>io.vavr</groupId>
  <artifactId>vavr</artifactId>
  <version>1.1.0</version>
</dependency>

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import org.jooq.lambda.Seq;
import org.jooq.lambda.tuple.Tuple;
import org.jooq.lambda.tuple.Tuple2;
import org.jooq.lambda.Unchecked;

// Zip two streams into tuples — no custom collector required
Seq<Tuple2<String, Integer>> scored = Seq.of("alice", "bob", "carol")
    .zip(Seq.of(91, 84, 77));

scored.forEach(t -> System.out.println(t.v1() + " -> " + t.v2()));

// Index a stream without an AtomicInteger hack
Seq.of("a", "b", "c")
    .zipWithIndex()
    .forEach(t -> System.out.println(t.v2() + ": " + t.v1()));

// Checked exceptions inside lambdas, without try/catch noise
Seq.of("config.yml", "missing.yml")
    .map(Unchecked.function(path -> Files.readString(Path.of(path))))
    .onError(t -> System.err.println(t.getCause().getMessage()))
    .toList();

Dependency coordinates, current release 0.9.16:

1
2
3
4
5
<dependency>
  <groupId>org.jooq</groupId>
  <artifactId>jool</artifactId>
  <version>0.9.16</version>
</dependency>

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.

1
2
3
4
5
6
7
8
9
import fj.F;
import fj.data.List;
import fj.data.Option;

List<Integer> numbers = List.list(1, 2, 3, 4);
List<Integer> doubled = numbers.map(i -> i * 2);

Option<String> name = Option.fromNull(System.getProperty("user.name"));
String display = name.option("anonymous", n -> n.toUpperCase());

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:

  1. 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.
  2. Boundary friction. Vavr needs .toJavaOptional() / .toJavaList() at framework edges. Functional Java needs full adapters. jOOλ needs nothing.
  3. Onboarding. A developer who knows Stream can read jOOλ in an hour. Reading Vavr’s Validation and Either correctly takes a week of practice, mostly to stop reaching for exceptions.
  4. 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.List with java.util.List in the same API. Pick one per module. Half-migrated modules produce the worst of both: conversion noise plus duplicate imports.
  • Try is not a substitute for transactions. Catching a Try.Failure after a database write does not roll anything back. Keep transactional boundaries in the service layer, and use Try only to make failure composable.
  • Either left types drift. Without a sealed error hierarchy, you end up with Either<String, T> and Either<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-vavr or your Option fields will serialize as {}.
  • Watch the lambda capture in Unchecked. It erases the checked type, so a catch (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.

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