GithubHelp home page GithubHelp logo

wesleyegberto / java-new-features Goto Github PK

View Code? Open in Web Editor NEW
276.0 13.0 79.0 2.97 MB

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

License: Apache License 2.0

Java 97.15% Shell 2.31% HTML 0.19% C 0.35%
java-8 java-9 java-10 java-11 java-12 java-13 java-14 java-15 java-16 java-17

java-new-features's Introduction

Java New Features

A project to explore more about the new features from Java 8 through Java 21.

JDK Release Notes

OpenJDK Projects

  • Valhalla: enhance Java object model with value objects and primitive values.
  • Loom: project to bring user-mode threads.

Resume by Version

  • Java 23

    • Primitive Types in Patterns, instanceof and switch (preview)
  • Java 22 (Mar, 2024)

    • Statements before super (preview)
    • FFM API (standard)
    • Unnamed Variable & Patterns
    • Launch Multi-File Source-Code Programs
    • String Templates (preview 2)
    • Stream Gatherers (preview)
    • Structured Concurrency (preview 2)
    • Scoped Value (preview 2)
  • Java 21 (LTS; Sep, 2023)

    • Virtual Threads (standard) ๐Ÿš€
    • Record Pattern (standard) ๐Ÿš€
    • Pattern Matching for switch (standard) ๐Ÿš€
    • Sequenced Collections
    • String Templates (preview)
    • Foreign Function & memory API (preview 3)
    • Unnamed Patterns and Variables (preview)
    • Unnamed Classes and Instance Main Methods (preview)
    • Prepare to Disallow the Dynamic Loading of Agents
    • KEM API
    • Structured Concurrency (preview)
    • Scoped Value (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)
  • 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)

    • Sealed classes (standard)
    • Pattern matching for switch (preview)
    • Enhanced Pseudo-Random Number Generator
    • Deprecate the Applet API for Removal
    • New macOS rendering for Java 2D API
    • Remove the experimental AOT and JIT compiler
  • 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>

Helpful Links

java-new-features's People

Contributors

3neef avatar wesleyegberto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-new-features's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.