Slide 1

Slide 1 text

IntelliJ IDEA ©JetBrains. All rights reserved Life Beyond Java 8 Trisha Gee (@trisha_gee) Java Developer Advocacy Lead, JetBrains

Slide 2

Slide 2 text

https://blog.jetbrains.com/idea/2020/09/a-picture-of-java-in-2020/ Java 8 remains the most popular version. It is used by 75% of professional developers who use Java as their primary language.

Slide 3

Slide 3 text

https://www.infoq.com/news/2020/03/new-relic-jvm-report/ https://snyk.io/wp-content/uploads/jvm_2020.pdf “The majority of JVMs (over 85%) are running on Java 8”

Slide 4

Slide 4 text

Releases, Updates, Licensing & Support

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

We have two types of releases

Slide 7

Slide 7 text

We have two types of releases Releases and LTS (Long Term Support) releases

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

$$$ $$$

Slide 10

Slide 10 text

$$$ $$$

Slide 11

Slide 11 text

https://flic.kr/p/8xhk74

Slide 12

Slide 12 text

Java 11 Long Term Support (LTS) Release; ~3 years support

Slide 13

Slide 13 text

Java 15 Current release; be prepared to upgrade in March 2021

Slide 14

Slide 14 text

https://jdk.dev

Slide 15

Slide 15 text

IntelliJ IDEA can help you

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Why bother?

Slide 18

Slide 18 text

Java 11 Long Term Support (LTS) Release

Slide 19

Slide 19 text

JShell

Slide 20

Slide 20 text

var

Slide 21

Slide 21 text

Convenience Factory Methods for Collections

Slide 22

Slide 22 text

Collecting to Unmodifable Collections items.stream() .filter(Objects!::nonNull) .map(Object!::toString) .collect(Collectors.toUnmodifiableList());

Slide 23

Slide 23 text

New Methods on Stream API items.stream() .takeWhile(user !-> user.count() < maxCount) .forEach(user !-> position.incrementAndGet());

Slide 24

Slide 24 text

Predicate.not()

Slide 25

Slide 25 text

New Methods on Optional

Slide 26

Slide 26 text

Built in Http Client

Slide 27

Slide 27 text

• https://blog.jetbrains.com/idea/2017/10/creating- multi-release-jar-files-in-intellij-idea/ Multi Release Jar Files

Slide 28

Slide 28 text

Jigsaw

Slide 29

Slide 29 text

Java Module System

Slide 30

Slide 30 text

JLink

Slide 31

Slide 31 text

Java 15 Current Release

Slide 32

Slide 32 text

Switch Expressions

Slide 33

Slide 33 text

Switch Expressions https://jb.gg/ij-jdk12

Slide 34

Slide 34 text

Text Blocks

Slide 35

Slide 35 text

Text Blocks https://jb.gg/ij-jdk13

Slide 36

Slide 36 text

Hidden classes

Slide 37

Slide 37 text

Hidden classes JEP 371

Slide 38

Slide 38 text

A Scalable Low-Latency Garbage Collector

Slide 39

Slide 39 text

A Scalable Low-Latency Garbage Collector JEP 377

Slide 40

Slide 40 text

Preview Features

Slide 41

Slide 41 text

Pattern Matching for instanceof

Slide 42

Slide 42 text

Pattern Matching for instanceof https://jb.gg/ij-jdk14

Slide 43

Slide 43 text

Records

Slide 44

Slide 44 text

Records https://jb.gg/ij-jdk14

Slide 45

Slide 45 text

Sealed Types

Slide 46

Slide 46 text

Sealed Types https://jb.gg/ij-jdk15

Slide 47

Slide 47 text

https://openjdk.java.net/projects/jdk/15/

Slide 48

Slide 48 text

The Future

Slide 49

Slide 49 text

• JEP 302: Lambda Leftovers (including underscore for param) • JEP 360: Sealed Types (Preview) • JEP draft: Pattern matching for switch (Preview) • Project Amber • Valhalla • Loom • Lots of Garbage Collection improvements Java 16

Slide 50

Slide 50 text

• Project Amber • Valhalla • Loom • More Garbage Collection improvements • Proposed New Project: Leyden And in the future?

Slide 51

Slide 51 text

The Business Doesn’t Care About Language Features

Slide 52

Slide 52 text

Performance

Slide 53

Slide 53 text

Use of Memory

Slide 54

Slide 54 text

• Java 9: JEP 248: G1 the Default GC • Java 10: JEP 307: Parallel Full GC for G1 • Java 11: JEP 318: Epsilon (Experimental) • Java 11: JEP 333: ZGC (Experimental) Garbage Collection (Java 11)

Slide 55

Slide 55 text

• Java 12: More Updates to G1 • Java 14: Deprecate the ParallelScavenge + SerialOld GC Combination • Java 15: ZGC (Production) • Java 15: Shenandoah (Production) Garbage Collection (Java 15)

Slide 56

Slide 56 text

Cost

Slide 57

Slide 57 text

Cost £$€

Slide 58

Slide 58 text

Tips for Migration

Slide 59

Slide 59 text

Run on updated JDK

Slide 60

Slide 60 text

Run on updated JDK It might “just work”

Slide 61

Slide 61 text

Address compiler warnings

Slide 62

Slide 62 text

Address compiler warnings …they are there for a reason

Slide 63

Slide 63 text

Update your dependencies

Slide 64

Slide 64 text

Update your dependencies And add new ones

Slide 65

Slide 65 text

Update your build tool

Slide 66

Slide 66 text

Update your build tool Updated Maven and Gradle required

Slide 67

Slide 67 text

Compile against updated JDK

Slide 68

Slide 68 text

Compile against updated JDK …and start using the shiny new features

Slide 69

Slide 69 text

https://bit.ly/8-to-11

Slide 70

Slide 70 text

In Summary

Slide 71

Slide 71 text

Modern Java Can Help You

Slide 72

Slide 72 text

Modern Java Can Help You Performance, cost, maintenance…

Slide 73

Slide 73 text

There are two upgrade options

Slide 74

Slide 74 text

There are two upgrade options To Java 11 (LTS) or to Java 15 (upgrade every 6 months)

Slide 75

Slide 75 text

Upgrade Now And Reduce Future Pain

Slide 76

Slide 76 text

Upgrade Now And Reduce Future Pain …and keep upgrading, at least in CI

Slide 77

Slide 77 text

https://bit.ly/love-beyond-8 @trisha_gee