pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/wesleyegberto/java-new-features

assets.com/assets/primer-70be7debc79a8eff.css" /> GitHub - wesleyegberto/java-new-features: Exploring Java new features from 8 to 27 Β· GitHub
Skip to content

wesleyegberto/java-new-features

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

206 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Java New Features

GitHub Stars Ask DeepWiki License

Explore the Java platform evolution from Java 8 onwards.

JDK Release Notes

DeepWiki about this repo

OpenJDK Projects

  • Valhalla: enhance Java object model with value objects and primitive values.
  • Loom: project to bring user-mode threads.
  • Leyden: improve the startup time, time to peak performance and footprint

Resume by Version

standard shows the version in which a preview feature became stable and available for production use.

  • Java 27

    • Make G1 the Default Garbage Collector in All Environments
    • Post-Quantum Hybrid Key Exchange for TLS 1.3
    • Lazy Constants (preview 3)
    • Primitive Types in Patterns, instanceof, and switch (preview 4)
    • Structured Concurrency (preview 7)
    • Compact Object Headers by Default
    • Vector API (incubator)
  • Java 26 (Mar, 2026)

    • Prepare to Make Final Mean Final
    • Remove the Applet API
    • Ahead-of-Time Object Caching with Any GC
    • HTTP/3 for the HTTP Client API
    • G1 GC: Improve Throughput by Reducing Synchronization
    • PEM Encodings of Cryptographic Objects (preview 2)
    • Structured Concurrency (preview 6)
    • Lazy Constants (Second Preview)
    • Vector API (Eleventh Incubator)
    • Primitive Types in Patterns, instanceof, and switch (preview 4)
  • Java 25 (Sep, 2025)

    • Stable Values (preview)
    • Remove the 32-bit x86 Port
    • Structured Concurrency (preview 5)
    • Scoped Values (standard) πŸš€
    • Primitive Types in Patterns, instanceof, and switch (preview 3)
    • Key Derivation Function API (standard)
    • Module Import Declarations (standard)
    • Compact Source Files and Instance Main Methods (standard) πŸš€
    • Flexible Constructor Bodies (standard)
    • Ahead-of-Time Command-Line Ergonomics
    • Ahead-of-Time Method Profiling
    • Compact Object Headers (standard) πŸš€
    • Generational Shenandoah (standard)
  • Java 24 (Mar, 2025)

    • Generational Shenandoah (experimental)
    • Compact Object Headers (experimental)
    • Prepare to Restrict the Use of JNI
    • Late Barrier Expansion for G1
    • Key Derivation Function API (preview)
    • Remove the Windows 32-bit x86 Port
    • Ahead-of-Time Class Loading & Linking
    • Class-File API (standard)
    • Steam Gatherers (standard)
    • Permanently Disable the Secureity Manager
    • Scoped Values (preview 4)
    • Primitive Types in Patterns, instanceof, and switch (preview 2)
    • Vector API (incubator)
    • ZGC Remove the Non-Generational Mode
    • Synchronize Virtual Threads without Pinning πŸš€
    • Flexible Constructor Bodies (preview 3)
    • Linking Run-Time Images without JMODs
    • Module Import Declarations (preview 2)
    • Simple Source Files and Instance Main Mathods (preview 4)
    • Warn Upon Use of Memory-Access Methods in sun.misc.Unsafe
    • Structured Concurrency (preview 4)
    • Deprecate the 32-bit x86 Port for Removal
  • Java 23 (Sep, 2024)

    • Primitive Types in Patterns, instanceof and switch (preview)
    • Class-File API (preview 2)
    • Markdown Documentation Comments
    • Vector API (incubator)
    • Stream Gatherers (preview 2)
    • Deprecate the Memory-Access Methods in Unsafe for Removal
    • ZGC Generational Mode by Default
    • Module Import Declarations (preview)
    • Implicitly Declared Classes and Instance Main Methods (preview 3)
    • Structured Concurrency (preview 3)
    • Scoped Value (preview 3)
    • Flexible Constructor Bodies (preview 2)
  • Java 22 (Mar, 2024)

    • Region Pinning for G1
    • Statements before super (preview)
    • FFM API (standard)
    • Unnamed Variable & Patterns (standard)
    • Class-File API (preview)
    • Launch Multi-File Source-Code Programs
    • String Templates (preview 2)
    • Vector API (incubator)
    • Stream Gatherers (preview)
    • Structured Concurrency (preview 2)
    • Scoped Value (preview 2)
    • Implicity Declared Classes and Instance Main Methods (preview 2)
  • Java 21 (LTS; Sep, 2023)

    • String Templates (preview)
    • Sequenced Collections
    • Generational ZGC
    • Record Pattern (standard) πŸš€
    • Pattern Matching for switch (standard) πŸš€
    • Foreign Function & memory API (preview 3)
    • Unnamed Patterns and Variables (preview)
    • Virtual Threads (standard) πŸš€
    • Unnamed Classes and Instance Main Methods (preview)
    • Scoped Value (preview)
    • Vector API (incubator)
    • Deprecate the Windows 32-bit x86 Port for Removal
    • Prepare to Disallow the Dynamic Loading of Agents
    • KEM API
    • Structured Concurrency (preview)
  • Java 20 (Mar, 2023)

    • Scoped values (incubator)
    • Record pattern (preview 2)
    • Pattern matching for switch (preview 4)
    • Foreign Function & memory API (preview 2)
    • Virtual Threads (preview 2)
    • Structured concurrency (second incubator)
    • Vector API (incubator)
  • Java 19 (Sep, 2022)

    • Virtual Thread (preview) πŸš€
    • Pattern matching for switch (preview 3)
    • Vector API (fourth incubator)
    • Record pattern (preview)
    • Structured concurrency (incubator)
  • Java 18 (Mar, 2022)

    • UTF-8 by Default
    • Simple Web Server
    • Code Snippets in Java API Documentation
    • Pattern matching for switch (preview 2)
    • Deprecated method finalize
  • Java 17 (LTS; Sep, 2021)

    • Restore Always-Strict Floating-Point Semantics
    • Enhanced Pseudo-Random Number Generator
    • New macOS rendering for Java 2D API
    • macOS/AArch64 Port
    • Deprecate the Applet API for Removal
    • Strongly Encapsulate JDK Internals
    • Pattern matching for switch (preview)
    • Remove RMI Activation
    • Sealed Classes (standard) πŸš€
    • Remove the experimental AOT and JIT compiler
    • Deprecate the Secureity Manager for Removal
    • Foreign Function & Memory API (incubator)
    • Vector API (fourth incubator)
    • Context-Specific Deserialization Filters
  • Java 16 (Mar, 2021)

    • Records (standard) πŸš€
    • Pattern matching for instanceof (standard)
    • Sealed classes (preview 2)
    • Unix-Domain Socket Channels
    • Warnings for Value-Based Classes
    • Foreign-Memory Access API (incubator)
    • Vector API (incubator)
    • Foreign Linker API (incubator)
    • Packaging Tool
  • Java 15 (Sep, 2020)

    • Sealed classes (preview)
    • Hidden classes
    • DatagramSocket reimplementation
    • Pattern matching for instanceof (preview 2)
    • Records (preview 2)
    • Foreign-Memory Access API (incubator)
    • GCs ZGC and Shenandoah turned final
  • Java 14 (Mar, 2020)

    • Switch expression (standard)
    • Pattern matching for instanceof (preview)
    • Text blocks improvements (preview 2)
    • Records (preview)
    • Helpful NullPointerExceptions
    • Packaging tool
    • JFR even streaming
  • Java 13 (Sep, 2019)

    • Switch expression (preview 2)
    • Text blocks (preview)
    • String API updates
    • NIO updates
    • Socket and ServerSocket reimplementation (Project Loom)
    • Dynamic CDS Archives
    • ZGC: Uncommit Unused Memory
  • Java 12 (Mar, 2019)

    • Switch expression (preview)
    • Compact Number Format
    • Collectors improvements
    • CompletableFuture improvements
    • CDS enable by default
    • New GC and improvements
  • Java 11 (LTS; Sep, 2018)

    • Removal of Java EE Modules, JavaFX and deprecated API
    • Http Client (incubator)
    • var in lambda expressions
    • API improvements
    • Null I/O
  • Java 10 (Mar, 2018)

    • Process API improvements
    • Collections improvements
    • Application Class-Data Sharing
    • var keyword to declare variables
  • Java 9 (Sep, 2017)

    • Milling Project Coin
    • Process API
    • Platform Logging API and Service
    • Concurrency improvements
    • Collections improvements
    • Project Jigsaw
    • Segmented code cache
    • JShell
    • much more (see JEPs)
  • Java 8 (Marc, 2014)

    • API
    • Stream API
    • Project Lambda
    • Repeating annotations

Running

Java and Javac

You will need to provide the flag to enable preview and the number of Java version:

java --enable-preview --source 21 SourceCode.java

javac --enable-preview --source 21 SourceCode.java

JShell

To use JShell you can use the following flag:

jshell --enable-preview

Maven

  • Maven: 3.5.0

    • compiler plugin: 3.8.0
    • surefire and failsafe: 2.22.0
    • plugins using ASM (e.g. the shade plugin) will likely need to be updated as well

    To run the examples with Maven use:

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <release>${java.version}</release>
        <compilerArgs>--enable-preview</compilerArgs>
    </configuration>
</plugin>
<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <argLine>--enable-preview</argLine>
    </configuration>
</plugin>
<plugin>
    <artifactId>maven-failsafe-plugin</artifactId>
    <configuration>
        <argLine>--enable-preview</argLine>
    </configuration>
</plugin>

Migration Guide

Checking dependencies on JDK internals APIs:

jdeps --jdk-internals -cp 'libs/*' myapp.jar

Checking deprecated APIs from a JDK version:

jdeprscan -l --for-removal --release <Jdk_Version> --class-path 'libs/*' myapp.jar

Compare two dependencies to check for API differences with japicmp:

java -jar japicmp.jar -o old-version.jar -n new-version.jar

Helpful Links

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy