Skip to content

Java Evolution

Neelu edited this page Jul 26, 2026 · 4 revisions

Welcome to the java-features wiki!

☕ Java Evolution Map — Java 8 to Java 25

Work Flying GIF by Alliance

A visual journey through modern Java. Every version's guide lives inside its own package, right next to the runnable code that demonstrates it — this page is the map that gets you there.

Java 8 Java 9 Java 10 Java 11 Java 12 Java 13 Java 14 Java 15 Java 16 Java 17 Java 18 Java 19 Java 20 Java 21 Java 22 Java 23 Java 24 Java 25

Yellow = LTS release. Click any badge to jump straight to that version's guide.


📖 Table of Contents


🌳 Feature Lineage — How Big Features Matured

The journey map tells you when. This tells you how a feature grew up — most of Java's biggest features didn't ship all at once, they went through multiple preview rounds before standardizing. Tracing that lineage is the fastest way to understand why a feature works the way it does today.

flowchart LR
    subgraph Records["📦 Records"]
        direction LR
        R14["Java 14\nPreview"] --> R15["Java 15\n2nd Preview"] --> R16["Java 16\n✅ STANDARD"] --> R19["Java 19\n+ Record Patterns\n(preview)"] --> R21R["Java 21\n✅ Patterns STANDARD"]
    end

    subgraph Sealed["🔒 Sealed Classes"]
        direction LR
        SE15["Java 15\nPreview"] --> SE16["Java 16\n2nd Preview"] --> SE17["Java 17\n✅ STANDARD"]
    end

    subgraph Pattern["🧩 Pattern Matching"]
        direction LR
        PM14["Java 14\ninstanceof preview"] --> PM16["Java 16\ninstanceof ✅"] --> PM17["Java 17\nswitch preview"] --> PM21["Java 21\nswitch ✅ STANDARD"]
    end

    subgraph Loom["🧵 Virtual Threads"]
        direction LR
        VT19["Java 19\nPreview"] --> VT20["Java 20\n2nd Preview"] --> VT21["Java 21\n✅ STANDARD"] --> VT24["Java 24\nNo-pinning fix"]
    end

    style Records fill:#fff4e0,stroke:#cc8800
    style Sealed fill:#e8f0ff,stroke:#3355cc
    style Pattern fill:#f0e8ff,stroke:#7733cc
    style Loom fill:#e0fff0,stroke:#009966
Loading

Why this matters: if you only read the Java 21 guide, switch pattern matching looks like it appeared from nowhere. It didn't — it's the payoff of three releases of preview iteration (14 → 16 → 17 → 21). Understanding the lineage tells you which parts are battle-tested vs. which parts are still settling in whatever version you're on.

🔗 Same story — use the badges at the top of the page to open any version in this lineage.


📂 Open a Version Guide

Each version's README lives inside its own package, next to real .java example files you can run — click through for full write-ups, diagrams, best practices, and migration notes.

Version Release Type Headline Feature Guide & Code
🧱 Java 8 Mar 2014 LTS Lambdas & Streams java8/
🧱 Java 9 Sep 2017 Standard Module System (Jigsaw) java9/
🧱 Java 10 Mar 2018 Standard Local Var Type Inference (var) java10/
🧱 Java 11 Sep 2018 LTS HTTP Client, String/Files APIs java11/
📦 Java 12 Mar 2019 Standard Switch Expressions (Preview) java12/
📦 Java 13 Sep 2019 Standard Text Blocks (Preview) java13/
📦 Java 14 Mar 2020 Standard Records (Preview), Helpful NPEs java14/
📦 Java 15 Sep 2020 Standard Text Blocks ✅, Sealed (Preview) java15/
📦 Java 16 Mar 2021 Standard Records ✅ java16/
📦 Java 17 Sep 2021 LTS Sealed Classes ✅ java17/
🧵 Java 18 Mar 2022 Standard UTF-8 by Default, Web Server java18/
🧵 Java 19 Sep 2022 Standard Virtual Threads (Preview) java19/
🧵 Java 20 Mar 2023 Standard Scoped Values (Incubator) java20/
🧵 Java 21 Sep 2023 LTS Virtual Threads ✅ java21/
⚙️ Java 22 Mar 2024 Standard Foreign Function & Memory ✅ java22/
⚙️ Java 23 Sep 2024 Standard Primitive Patterns, Markdown Javadoc java23/
⚙️ Java 24 Mar 2025 Standard Stream Gatherers ✅ java24/
⚙️ Java 25 Sep 2025 LTS (latest — fill in as released) java25/

💡 GitHub doesn't execute click-events inside rendered Mermaid diagrams, so the map above is for understanding the shape of Java's evolution — use this table for actual navigation.


🧭 Which LTS Should You Target?

flowchart TD
    Start["Starting a new project\nor planning an upgrade?"] --> Q1{"Need Virtual Threads /\nmodern pattern matching?"}
    Q1 -->|Yes| J21["✅ Java 21 LTS\n(current recommended baseline)"]
    Q1 -->|No, stability over features| Q2{"Locked to Spring Boot 3+\nor Jakarta EE 10?"}
    Q2 -->|Yes| J17min["Java 17 minimum\n→ prefer Java 21 if possible"]
    Q2 -->|No, legacy constraints| Q3{"Stuck on old libraries\nrequiring deep reflection?"}
    Q3 -->|Yes| J11["Java 11 LTS\n(last version before strong\nencapsulation enforcement)"]
    Q3 -->|No| J21b["✅ Java 21 LTS"]
    J21 --> Latest{"Java 25 LTS released\nand ecosystem-ready?"}
    J21b --> Latest
    Latest -->|Yes| J25["🚀 Java 25 LTS\n(newest, longest support runway)"]
    Latest -->|Not yet| Stay["Stay on 21 until\nframework/library support matures"]
Loading

🎨 Feature Comparison Matrix

Feature Java 8 Java 11 Java 14 Java 17 Java 21 Java 25
Lambdas & Functional ✅ New
Streams API ✅ New ✅ Enhanced
Type Inference (var) ✅ New ✅ Enhanced
Records 🔄 Preview ✅ Enhanced
Sealed Classes ✅ Enhanced
Pattern Matching 🔄 Preview 🔄 Preview ✅ Enhanced
Text Blocks 🔄 Preview 🔄 Preview
Virtual Threads ✅ Standard
Structured Concurrency 🔄 Preview
FFM API (native interop) 🔄 Incubator 🔄 Preview

🚀 Getting Started

Prerequisites

# Install Java (recommend using SDKMAN — different packages below need different JDKs,
# since some example files use preview features tied to a specific JDK version)
curl -s "https://get.sdkman.io" | bash
sdk install java 21.0.1-tem
sdk use java 21.0.1-tem

⚠️ Note on JDK versions per package: pom.xml currently targets Java 19. The java8java19 packages compile fine under that baseline. Packages java20java25 use newer/preview APIs (Scoped Values, Virtual Threads on 21, FFM API on 22, Primitive Patterns preview on 23, Stream Gatherers on 24) and need a matching newer JDK — see the header comment at the top of each .java file for its exact requirement, and switch JDKs with sdk use java <version>-tem before compiling that specific package.

Clone & Explore

git clone https://github.com/temptation4/java-features.git
cd java-features

# Run a specific example directly (adjust JDK per the note above)
javac -d out --enable-preview --release 21 src/main/java/java21/*.java
java --enable-preview -cp out java21.RecordPatternDemo

📁 Project Structure

Docs live with the code they describe — open a package, read README.md, then run the .java files right next to it.

java-features/
├── README.md                     # This file — the map
├── pom.xml
├── src/main/java/
│   ├── java8/
│   │   ├── README.md             # Full Java 8 write-up
│   │   └── LambdaStreamsExample.java
│   ├── java9/
│   │   ├── README.md
│   │   └── ... (module system, JShell, stream enhancements examples)
│   ├── java10/ ... java19/       # Each: README.md + existing examples
│   ├── java20/
│   │   ├── README.md
│   │   └── ScopedValueExample.java
│   ├── java21/
│   │   ├── README.md
│   │   ├── VirtualThreadDemo.java
│   │   └── RecordPatternDemo.java
│   ├── java22/
│   │   ├── README.md
│   │   └── ForeignFunctionExample.java
│   ├── java23/
│   │   ├── README.md
│   │   └── PrimitivePatternExample.java
│   ├── java24/
│   │   ├── README.md
│   │   └── StreamGatherersExample.java
│   └── java25/
│       ├── README.md             # Template — fill in as Java 25 features are confirmed
│       └── Java25Placeholder.java

🎓 Learning Path

Beginner (Java 8 Fundamentals)

  1. Lambdas → Understand functional programming basics
  2. Streams API → Master data processing patterns
  3. Functional Interfaces → Learn the foundation

Time: 1-2 weeks | Start here: java8/README.md

Intermediate (Modern Java — Java 11 to 17)

  1. Type Inference (var) → Write cleaner code
  2. Records → Replace boilerplate getters/setters
  3. Pattern Matching → More expressive conditionals
  4. Sealed Classes → Better control over inheritance

Time: 2-3 weeks | Path: java11/java17/

Advanced (Concurrent Java — Java 19+)

  1. Virtual Threads → Lightweight concurrency
  2. Structured Concurrency → Safe concurrent programming
  3. Pattern Matching in Switch → Advanced control flow
  4. Foreign Function & Memory → Interop with native code

Time: 3-4 weeks | Path: java21/java25/


💡 Key Highlights by Category

🔤 Language Features

  • Java 8: Lambdas, Method References
  • Java 14-17: Records, Switch Expressions, Pattern Matching
  • Java 21+: Sealed Classes, Text Blocks, Advanced Pattern Matching

📦 Concurrency Revolution

  • Java 8: CompletableFuture introduced
  • Java 19-21: Virtual Threads (lightweight concurrency)
  • Java 21: Structured Concurrency for safe async patterns

📝 API Improvements

  • Java 11: var, String.lines(), Files.readString()
  • Java 16: Stream enhancements, Collectors improvements
  • Java 18+: Simple Web Server, Enhanced DateTimeFormatter

🔐 Performance & Security

  • Java 17: Strong JDK encapsulation (internal classes hidden)
  • Java 21: Virtual Threads improve throughput for I/O-bound workloads
  • Java 22+: Foreign Function & Memory API (safer native interop)

🤝 Contributing

Found a bug? Have a suggestion? Want to add more examples?

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-example)
  3. Commit changes (git commit -m 'Add amazing example for Java 21')
  4. Push to branch (git push origin feature/amazing-example)
  5. Open a Pull Request

📞 Community & Support

Questions?

Follow for Updates

  • ⭐ Star this repo to stay updated
  • 👀 Watch for new Java version releases
  • 🔔 Subscribe to discussions

📄 License

This project is open-source and available under the MIT License.


👨‍💻 Author

Neelu Sahai Java Architect | Backend Engineer | Open Source Contributor


🚀 Ready to Master Modern Java?

👉 Start with Java 8 | 🏃 Jump to Java 21 (LTS) | 🔮 Explore Java 25

Made with ☕ and ❤️ by Neelu Sahai

Clone this wiki locally