GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-new-features/java-12 at master · jhavierc/java-new-features

Expand file tree

/

java-12

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

java-12

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
CollectorsTeeingTest.java
CollectorsTeeingTest.java
 
 
CompactNumberFormatExample.java
CompactNumberFormatExample.java
 
 
CompletableFutureTest.java
CompletableFutureTest.java
 
 
README.md
README.md
 
 
SwitchExpressionExample.java
SwitchExpressionExample.java
 
 

README.md

Outline

Java 12

To run each example use: java --enable-preview --source 12 <FileName.java>

Features

Language

  • Switch expression
  • Collectors.teeing
  • More Versatile Error Recovery With CompletableFuture
    • exceptionallyAsync(Function<Throwable, ? extends T> f)
    • exceptionallyAsync(Function<Throwable, ? extends T> f, Executor e)
    • exceptionallyCompose(Function<Throwable, ? extends CompletionStage<T>> f)
    • exceptionallyComposeAsync(Function<Throwable, ? extends CompletionStage<T>> f)
    • exceptionallyComposeAsync(Function<Throwable, ? extends CompletionStage<T>> f, Executor e)
  • Compact Number Format

JVM

  • Default CDS Archives
    • -Xshare:off to disable it
  • Garbage Collection
    • Shenandoah: Red Hat low-pause-time GC, experimental;
    • G1: improvements and promptly returns unused memory SO;

JEPs

  • 12 - Preview language and VM features
  • 189 - Low-Pause-Time GC (experimental)
  • 230 - Microbenchmark Suite
  • 325 - Switch expressions (preview)
  • 334 - JVM Constants API
  • 340 - One AArch64
  • 341 - Default CDS Archives
  • 344 - Abortable mixed collections for G1
  • 345 - Promptly return unused memory from G1

Warnings

Tools:

  • Maven: 3.5.0
    • compiler plugin: 3.8.0
    • surefire and failsafe: 2.22.0
<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <compilerArgs>
            --enable-preview
        </compilerArgs>
    </configuration>
</plugin>
<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <argLine>--enable-preview</argLine>
    </configuration>
</plugin>

Libs which manipulate bytecode that will need update:

  • Spring
  • Hibernate
  • Mockiot

Links

  • Java 12 Documentation
  • Java 12 Guide
  • Should you adopt Java 12 or stick on Java 11?
  • Shenandoah GC
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.