-
Notifications
You must be signed in to change notification settings - Fork 0
Java Evolution
Welcome to the java-features wiki!
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.
Yellow = LTS release. Click any badge to jump straight to that version's guide.
- The Journey Map
- Feature Lineage — How Big Features Matured
- Open a Version Guide
- Which LTS Should You Target?
- Feature Comparison Matrix
- Getting Started
- Project Structure
- Learning Path
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
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.
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.
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"]
| 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 | ✅ |
# 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.xmlcurrently targets Java 19. Thejava8–java19packages compile fine under that baseline. Packagesjava20–java25use 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.javafile for its exact requirement, and switch JDKs withsdk use java <version>-tembefore compiling that specific package.
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.RecordPatternDemoDocs 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
- Lambdas → Understand functional programming basics
- Streams API → Master data processing patterns
- Functional Interfaces → Learn the foundation
Time: 1-2 weeks | Start here: java8/README.md
- Type Inference (var) → Write cleaner code
- Records → Replace boilerplate getters/setters
- Pattern Matching → More expressive conditionals
- Sealed Classes → Better control over inheritance
Time: 2-3 weeks | Path: java11/ → java17/
- Virtual Threads → Lightweight concurrency
- Structured Concurrency → Safe concurrent programming
- Pattern Matching in Switch → Advanced control flow
- Foreign Function & Memory → Interop with native code
Time: 3-4 weeks | Path: java21/ → java25/
- Java 8: Lambdas, Method References
- Java 14-17: Records, Switch Expressions, Pattern Matching
- Java 21+: Sealed Classes, Text Blocks, Advanced Pattern Matching
- Java 8: CompletableFuture introduced
- Java 19-21: Virtual Threads (lightweight concurrency)
- Java 21: Structured Concurrency for safe async patterns
-
Java 11:
var,String.lines(),Files.readString() - Java 16: Stream enhancements, Collectors improvements
- Java 18+: Simple Web Server, Enhanced DateTimeFormatter
- 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)
Found a bug? Have a suggestion? Want to add more examples?
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-example) - Commit changes (
git commit -m 'Add amazing example for Java 21') - Push to branch (
git push origin feature/amazing-example) - Open a Pull Request
- 💬 Join the Java Community Discussion — got a question about Java 8, Virtual Threads, Records, Pattern Matching, or anything else here? Drop it in the thread.
- 📧 Reach out: neel4nov@gmail.com
- ⭐ Star this repo to stay updated
- 👀 Watch for new Java version releases
- 🔔 Subscribe to discussions
This project is open-source and available under the MIT License.
Neelu Sahai Java Architect | Backend Engineer | Open Source Contributor
- 📧 Email: neel4nov@gmail.com
- 🔗 LinkedIn: linkedin.com/in/neelu-sahai-6367681b
- 💻 GitHub: github.com/temptation4
👉 Start with Java 8 | 🏃 Jump to Java 21 (LTS) | 🔮 Explore Java 25
Made with ☕ and ❤️ by Neelu Sahai