Download presentation
Presentation is loading. Please wait.
Published byΣατάν Αυγερινός Modified over 6 years ago
1
Java 11 – Keeping the Java Release Train on the Right Track
Jeanne Boyarsky QCon– June 28, 2018 speakerdeck.com/boyarsky
2
So much changed since Java 9 & Jigsaw’s release!
Duke from: PowerPoint Jigsaw from:
3
What version of Java 11, 10, 9, …
4
https://speakerdeck.com/boyarsky/welcome-to-java-9?slide=1
For more on Java 9, see: PowerPoint Jigsaw from:
5
Topics: Ecosystem changes Language changes
6
About Me 16 years as Java Developer
7
Memories! Image from: Thought cloud from:
8
Java 8 (2014) Java 9 (2017) Java 7 (2011) Hi Oracle Til (2010) Java 6
(1996- 2006) Hi Oracle (2010) Java 7 (2011) Java 8 (2014) Java 9 (2017) Image from:
9
The Saga of Jigsaw 2011 – Maybe part of Java 7. Nope Plan B
Part of Java 8. No wait Part of Java 9 Image from:
10
Java 9 “Release” Dates Sept 2016 May 2017 July 2017 Sept 2017
Image from:
11
Counting lessons? 1.0, 1.1, 1.2, 1.3, 1.4 5.0 6, 7, 8, 9, 10, 11 Image from:
12
Advanced counting lessons
10 = 11 = 12 = ? Image from:
13
Wait, a major version every 6 months?
JDK 10 JDK 11 12 new features 15 new features + Syntax changes + Smaller features - Years of features Image from:
14
Predictability of Release D Developer Community A Features B
Frequency of Release F Predictability of Release D Java School Report Card Developer Community A Features B
15
Predictability of Release D Vocabulary B Polyglot programming A
Frequency of Release F Predictability of Release D JVM College Report Card Vocabulary B Polyglot programming A
16
Re-org at the train station
Image from: Thought cloud from:
17
How many languages do you know?
Examples Java Kotlin Groovy Scala SQL HTML JavaScript CSS One (or zero) Two – Five Six or more
18
Before Now Images from Cover: full stack, QCon, DevNexus
19
Before Now Images from Cover community ownership
20
Before Now Releases every Varies 6 months (or 3 years) Releases are Feature driven Date driven
21
More time to code while I wait for the next train!
22
Arrivals Train Schedule
Java Release Date Long Term Support 9 September 21, 2017 10 March 20, 2018 11 September 25, 2018 Images from
23
Security Patches Departure Schedule
Java Public Patches Paid Patches 6 2013 Late 2018 7 2015 2022 8 January 2019 (business) December 2020 (public) 2025 Images from
24
Security Patches Departure Schedule
Java Public patches Paid patches 9 March 2018 n/a 10 September 2018 11 March 2019 Images from
25
Wait. So what happens next?
How long will Java 12 have security patches? Answer: 6 months What is the next LTS version after Java 11? Java *2 = 17
26
A Tale of Two JDKs Java Oracle JDK Open JDK New Version Every 3 years
Every 6 months Cost Paid Free Upgrade Options Security patch Next version OpenJDK Interim security patch
27
Only bug fixes remain Only bug fixes allowed
28
Get ready to play
29
Tip: Aliases alias javac11=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/javac alias java11=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java
30
Local variable syntax (10/11)
Image from:
31
(10) String name = "Jeanne”; var name = "Jeanne"; List list = List.of(1, 2, 3); var list = List.of(1, 2, 3); Syntactical sugar/less boilerplate Not immutable (no val)
32
(10) var name = "Jeanne"; String name2 = name; Compiled code same with var
33
(10) List<WebElement> headers = thead.findElements(By.tagName("th")); VolunteerDashboardRow headerRow = new VolunteerDashboardRow(headers); vs var headers = thead.findElements(By.tagName("th")); var headerRow = new VolunteerDashboardRow(headers); Point out scanability
34
(10) var csvPath = createAndGetFile(CSV_DATA); try (var csvWriter = Files.newBufferedWriter(csvPath); var csvPrinter = new CSVPrinter(csvWriter, CSVFormat.DEFAULT)); { }
35
(10) Map<Integer, String> productMap1 = new HashMap<Integer, String>(); Map<Integer, String> productMap2 = new HashMap<>(); var productMap3 Not always less typing
36
(10) Where can we use? var name = "Jeanne"; var other = name + 2; var list = List.of(1, 2, 3); for (var num : list) {}
37
Where can’t we use? (10) class Inner { var bad = "abc"; } var noGood;
Also instance variables, etc
38
(10) Does this work? var var = "var";
39
Variable names matter more
(10) Pros Cons Less typing Loss of information Less redundancy Variable names matter more Can scan variable names Be careful!
40
(11) Lambdas Predicate<String> pred1 = p -> true; Predicate<String> pred2 = (String p) -> true; Predicate<String> pred3 = (var p) -> true; Useful for annotation
41
(11) Annotations BiPredicate< Map<Integer, String>, List<String>> func = var map, var list) -> true; Useful for annotation
42
(11) All or nothing Good (var map, var list) -> true No good (var map, list) -> true (var map, List list) -> true Useful for annotation
43
Garbage collection (10/11)
(permission from Chandra to reuse image)
44
Choose your own GC Who cares?
(10) Choose your own GC Who cares? Agile. With releases every 6 months, features are smaller
45
Faster Default GC (10) Java 8 Parallel Garbage Collector Java 9 G1 GC
G1 GC with parallel implementation For more, see
46
Regions & space vs speed
(10) Regions & space vs speed For more, see Slide from
47
Epsilon GC Never reclaims memory
(11) Epsilon GC Never reclaims memory Program proceeds until run out of heap GC never runs To use: -XX:+UseEpsilonGC (or) -XX:+UseNoGC With modification
48
Epsilon GC Good for Performance/memory stress test Very short programs
(11) Epsilon GC Good for Performance/memory stress test Very short programs Last ditch performance improvements (this probably isn’t you) With modification
49
Z GC Experimental 10ms or less pause time Only for Linux/x64
(11) Z GC Experimental 10ms or less pause time Only for Linux/x64 To use, enable both: -XX:+UnlockExperimentalVMOptions -XX:+UseZGC
50
Http Client (11) I’m done incubating!
Image from:
51
(11) var uri = " var client = HttpClient.newHttpClient(); var request = HttpRequest.newBuilder() .uri(URI.create(uri)) .build(); var response = client.send(request, BodyHandlers.ofString()); System.out.println(response.body());
52
(11) var client = HttpClient.newHttpClient(); var requests = uris.stream() .map(HttpRequest::newBuilder) .map(reqBuilder -> reqBuilder.build()) .collect(toList()); CompletableFuture.allOf(requests.stream() .map(r->client.sendAsync(r, ofString())) .toArray(CompletableFuture<?>[]::new)) .join(); From
53
Other APIs BodyHandlers – file, inputstream, string, discarding
(11) Other APIs BodyHandlers – file, inputstream, string, discarding Request Builder Options – Header, proxy, authenticator, http protocol version Methods – get/post/put/delete
54
Time Based Versioning (10)
Image from:
55
(10) String javaVersion = System.getProperty("java.version"); Runtime.Version version = Runtime.Version.parse(javaVersion); System.out.println(javaVersion + ": " + version.feature() + " " + version.interim() + " " + version.update() + " " + version.patch());
56
(10) 10.0.1 11-ea [deprecated] major() 10 11 [deprecated] minor() [deprecated] security() 1
57
(10) 10.0.1 11-ea feature() 10 11 interim() update() 1 patch()
58
Updates Examples feature() Every 6 months 10, 11, 12 interim()
(10) Updates Examples feature() Every 6 months 10, 11, 12 interim() n/a for Open JDK update() Within 6 months 0, 1, 2 patch() Emergencies
59
(10) 10.0.1 11-ea 2018-04-17 2018-09-25 Yes, the future!
System.out.println( System.getProperty("java.version.date")); 10.0.1 11-ea Yes, the future!
60
(10) Null for Open JDK For vendor use Yes, version is here twice!
System.out.println( System.getProperty("java.version.version")); Null for Open JDK For vendor use Yes, version is here twice!
61
Odds and Ends Image from :
62
New java launcher mode (11) Full command Shorthand
javac HelloWorld.java java HelloWorld java HelloWorld.java Produces class file Fully in memory For any program For programs with one class
63
Unmodifiable Collections
(10) Unmodifiable Collections Copying another Terminal operations List.copyOf Collectors.toUnmodifiableList Set.copyOf Collectors.toUnmodifiableSet Map.copyOf Collectors.toUnmodifiableMap
64
Behind the Scenes Nest based access control
(11) Behind the Scenes Nest based access control Remove hack for private access in nested classes Pay off tech debt
65
JDK Java EE/Corba Modules
(11) JDK Java EE/Corba Modules Java 11 Java 9 Deprecated for removal! Image from:
66
Deprecated for removal!
(11) Pack200 Tools Java 11 Use jlink to compress packages Deprecated for removal! Image from:
67
Deprecated for removal!
(11) Nashorn Java 11 Deprecated for removal! Challenging to maintain Unclear adoption May be adopted Made it into Java 11 two days before cutoff Image from:
68
Unicode 9 and 10 Support Languages + emoji (10+11) 🦒 🦔 🛸 🛷 🥨 🥤 🤛 🤜
Beware: didn’t show on my work computer
69
Tying it all together (10+11) import java.nio.charset.*;
public class Unicode { public static void main(String... args) { System.out.print("Have a \uD83C\uDF7A"); System.out.println(" or a \uD83E\uDD64"); } java11 Unicode.java Have a 🍺 or a 🥤
70
No need to be puzzled. Java 11 LTS 6 months New features Go tell your manager/team to be ready for September!
71
???
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.