SlideShare a Scribd company logo
Desde Java 8 hasta Java 17
Víctor Orozco - @tuxtor
5 de octubre de 2021
Nabenik
1
¿Como se hace Java?
De Java 8 hasta Java 17
Java 9
Java 10
Java 11
Java 12
Java 13
Java 14
Java 15
Java 16
Java 17
2
¿Como se hace Java?
¿Java?
• Lenguaje
• VM
• Bibliotecas/API
El conjunto es la plataforma Java (TM)
3
¿Como se actualiza Java?
• JCP - Java Community Process
• JSR - Java Specification Request
• JEP - Java Enhancement Proposal
• JCK - Java Compatibility Kit
4
¿Como se actualiza Java? - Java Enhancement Proposal
5
¿Como se actualiza Java? - Java Compatibility Kit
6
Distros
7
De Java 8 hasta Java 17
¿Que versión de Java se usa más en Guatemala?
Java 8
https://guatejug.github.io/jvm2021/
8
¿Que recibo con cada versión nueva de Java?
• Java - Lenguaje
• Java - Bibliotecas e APIs
• Java - Maquina Virtual de Java
Mejoras de tipo
• Incubation
• Preview (–flag)
• Definitiva
9
Java - Las mejoras que resaltan
• Java 9
• Modulos
• JShell
• HTTP/2
• Factory methods
• Java 10
• Type Inference
• Class Data Sharing
• Time based release
• Java 11
• String methods
• File methods
• Direct .java execution
• Java 12
• Switch expressions
• Java 13
• Text blocks
• Java 14
• Pattern matching
• Records
• Helpfull NPE
10
Java - Las mejoras que resaltan
• Java 15
• Sealed classes
• Nashorn removal
• SPARC/Solaris
removal
• Java 16
• Vector API (Incubator)
• C++ 14
• Records
• Java 17
• MacOS Metal
• Strong encapsulation
• Switch expression +
pattern matching
• AOT removal
• Applet deprecation
11
Java 9
JEP 222: jshell: The Java Shell (Read-Eval-Print Loop)
12
JEP 110: HTTP/2 Client
1 HttpRequest request = HttpRequest.newBuilder()
2 .uri(new URI("https://swapi.co/api/starships/9"))
3 .GET()
4 .build();
5
6 HttpResponse<String> response = HttpClient.newHttpClient()
7 .send(request, BodyHandlers.ofString());
8
9 System.out.println(response.body());
13
JEP 269: Convenience Factory Methods for Collections
Antes
1 Set<String> set = new HashSet<>();
2 set.add("a");
3 set.add("b");
4 set.add("c");
5 set = Collections.unmodifiableSet(set);
”Pro”
1 Set<String> set = Collections.unmodifiableSet(new HashSet<>(
Arrays.asList("a", "b", "c")));
Ahora
1 Set<String> set = Set.of("a", "b", "c");
14
JEP 213: Milling Project Coin - Private methods in interfaces
Antes
1 public interface Vehicle{
2 public void move();
3 }
Ahora
1 public interface Vehicle{
2 public default void makeNoise(){
3 System.out.println("Making noise!");
4 createNoise();
5 }
6
7 private void createNoise(){
8 System.out.println("Run run");
9 }
10 }
15
JEP 213: Milling Project Coin - Try-with-resources
Antes
1 BufferedReader reader = new BufferedReader(new FileReader("
langs.txt"));
2
3 try(BufferedReader innerReader = reader){
4 System.out.println(reader.readLine());
5 }
Ahora
1 BufferedReader reader = new BufferedReader(new FileReader("
langs.txt"));
2
3 try(reader){
4 System.out.println(reader.readLine());
5 } 16
Java 10
Java 10
286: Local-Variable Type Inference
296: Consolidate the JDK Forest into a Single Repository
304: Garbage-Collector Interface
307: Parallel Full GC for G1
310: Application Class-Data Sharing
312: Thread-Local Handshakes
313: Remove the Native-Header Generation Tool (javah)
314: Additional Unicode Language-Tag Extensions
316: Heap Allocation on Alternative Memory Devices
317: Experimental Java-Based JIT Compiler
319: Root Certificates
322: Time-Based Release Versioning
17
JEP 286: Local-Variable Type Inference
1 public static void main(String args[]){
2 var localValue = 99;
3 System.out.println(++localValue);
4 //localValue = "Foo"
5 }
18
JEP 310: Application Class-Data Sharing
1
java −XX:+UseAppCDS −XX : DumpLoadedClassList=classes . l s t − j a r demo−microservicio −
ee−microbundle . j a r
2
java −XX:+UseAppCDS −Xshare :dump −XX : SharedClassListFile =classes . l s t −XX :
SharedArchiveFile=app−cds . jsa demo−microservicio −ee−microbundle . j a r
3
java −XX:+UseAppCDS −Xshare : on −XX : SharedArchiveFile=app−cds . jsa − j a r demo−
microservicio −ee−microbundle . j a r
19
JEP 310: Application Class-Data Sharing
20
JEP 310: Application Class-Data Sharing
21
JEP 322: Time-Based Release Versioning
22
JEP 322: Time-Based Release Versioning
23
Java 11
Java 11
181: Nest-Based Access Control
309: Dynamic Class-File Constants
315: Improve Aarch64 Intrinsics
318: Epsilon: A No-Op Garbage Collector
320: Remove the Java EE and CORBA Modules
321: HTTP Client (Standard)
323: Local-Variable Syntax for Lambda
Parameters
324: Key Agreement with Curve25519 and
Curve448
327: Unicode 10
328: Flight Recorder
329: ChaCha20 and Poly1305 Cryptographic
Algorithms
330: Launch Single-File Source-Code Programs
331: Low-Overhead Heap Profiling
332: Transport Layer Security (TLS) 1.3
333: ZGC: A Scalable Low-Latency Garbage
Collector (Experimental)
335: Deprecate the Nashorn JavaScript Engine
336: Deprecate the Pack200 Tools and API
24
JEP 323: Local-Variable Syntax for Lambda Parameters
Antes
1 BiPredicate<String,String> demoPredicate =
2 (String a, String b) -> a.equals(b);
3 BiPredicate<String,String> demoPredicate =
4 (a, b) -> a.equals(b);
Ahora
1 BiPredicate<String,String> demoPredicate =
2 (var a, var b) -> a.equals(b);
Posibilidades
1 (@Nonnull var x, @Nullable var y) -> x.process(y)
25
JEP 330: Launch Single-File Source-Code Programs
26
Java 12
Java 12
189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
230: Microbenchmark Suite
325: Switch Expressions (Preview)
334: JVM Constants API
340: One AArch64 Port, Not Two
341: Default CDS Archives
344: Abortable Mixed Collections for G1
346: Promptly Return Unused Committed Memory from G1
27
325: Switch Expressions (Preview)
Antes
1 String langType = "";
2 switch (args[0]) {
3 case "Java":
4 case "Scala":
5 case "Kotlin":
6 langType = "Static typed";
7 break;
8 case "Groovy":
9 case "JavaScript":
10 langType = "Dynamic typed";
11 break;
12 }
13 System.out.println(langType);
28
325: Switch Expressions (Preview)
Ahora
1 String langType = switch (args[0]) {
2 case "Java", "Scala", "Kotlin" -> "Static typed";
3 case "Groovy", "JavaScript" -> "Dynamic typed";
4 default -> {
5 System.out.println("This meant to be a processing
block");
6 yield "Probably LISP :)";
7 }
8 };
9 System.out.println(langType);
29
Java 13
Java 13
350: Dynamic CDS Archives
351: ZGC: Uncommit Unused Memory
353: Reimplement the Legacy Socket API
354: Switch Expressions (Preview)
355: Text Blocks (Preview)
30
355: Text Blocks (Preview)
Antes
1 String html = "<html>n" +
2 " <body>n" +
3 " <p>Hello, world</p>n" +
4 " </body>n" +
5 "</html>n";
Ahora
1 String html = """
2 <html>
3 <body>
4 <p>Hello, world</p>
5 </body>
6 </html>
7 """; 31
Java 14
Java 14
305: Pattern Matching for instanceof (Preview)
343: Packaging Tool (Incubator)
345: NUMA-Aware Memory Allocation for G1
349: JFR Event Streaming
352: Non-Volatile Mapped Byte Buffers
358: Helpful NullPointerExceptions
359: Records (Preview)
361: Switch Expressions (Standard)
362: Deprecate the Solaris and SPARC Ports
363: Remove the Concurrent Mark Sweep (CMS)
Garbage Collector
364: ZGC on macOS
365: ZGC on Windows
366: Deprecate the ParallelScavenge + SerialOld
GC Combination
367: Remove the Pack200 Tools and API
368: Text Blocks (Second Preview)
370: Foreign-Memory Access API (Incubator)
32
JEP 359: Records (Preview)
Data carrier
1 record Person(String name, String email, int age) {}
Uso
1 Person foo = new Person("Marco", "example@mail.com",99);
2 System.out.println(foo);
3 //foo.name = "Polo";
33
305: Pattern Matching for instanceof (Preview)
Antes
1 if(o instanceof Person){
2 Person p = (Person)o;
3 System.out.println("Hello " + p.name());
4 }else{
5 System.out.println("Unknown object");
6 }
Ahora
1 if(o instanceof Person p){
2 System.out.println("Hello " + p.name());
3 }else{
4 System.out.println("Unknown object");
5 }
34
Java 15
Java 15
339: Addition of EdDSA (Edwards-Curve Digital
Signature Algorithm)
360: Preview for sealed classes
371: Addition of hidden classes in Java
372: Removal of the Nashorn JavaScript Engine
373: Legacy DatagramSocket API
reimplementation
374: Biased locking disablement and
deprecation
375: Second preview for instanceof pattern
matching
377: Addition of ZGC, the scalable, low-latency,
garbage collector for Java
378: Full inclusion of Java Text Blocks
379: Addition and enhancements of the
low-pause time Shenandoah garbage collector
381: Final remove of Solaris and SPARC Ports
383: Incubation of the Foreign-Memory Access
API
384: Second preview inclusion of Java Records
385: RMI Activation deprecation with the goal of
future removal
35
360: Sealed Classes (Preview)
Antes
1 public class Animal { ... }
2
3 public class Porsche extends Animal { ... }
Ahora
1 public abstract sealed class Animal
2 permits Dog, Cat, Wolf { ... }
36
360: Sealed Classes (Preview)
Antes
1 public class Animal { ... }
2
3 public class Porsche extends Animal { ... }
Pro
1 abstract sealed class Animal {
2 final class Dog extends Root { ... }
3 final class Cat extends Root { ... }
4 final class Wolf extends Root { ... }
5 ... }
37
371: Hidden Classes
Antes
1 ClassLoader::defineClass
Ahora
1 Lookup::defineHiddenClass
38
381: Remove the Solaris and SPARC Ports
39
383: Foreign-Memory Access API (Second Incubator)
1 VarHandle intHandle = MemoryHandles.varHandle(int.class,
2 ByteOrder.nativeOrder());
3
4 try (MemorySegment segment = MemorySegment.allocateNative(100)
) {
5 for (int i = 0; i < 25; i++) {
6 intHandle.set(segment, i * 4, i);
7 }
8 ...
40
Java 16
Java 16
338: Incubation of the Vector API
347: C++14 language features enablement
357: Migration from Mercurial to Git
369: GitHub migration of OpenJDK repositories
376: Concurrent thread-stack processing for
ZGC
380: Unix-Domain Socket Channels
386: Alpine Linux port
387: Support for elastic metaspace
388: The Windows AArch64 Port
389: Incubation of the Foreign Linker API
390: Value-based classes warnings
392: Addition of the Packaging Tool
393: Third incubation of the Foreign-Memory
Access API
394: Full inclusion of pattern matching for
instanceof
395: Full implementation of Java Records
396: Strongly encapsulation of JDK Internals
397: Second preview of sealed classes
41
386: Alpine Linux Port
42
389: Foreign Linker API (Incubator)
1 LibraryLookup libclang = LibraryLookup.ofLibrary("clang");
2 LibraryLookup.Symbol clangVersion = libclang.lookup("
clang_getClangVersion");
43
396: Strongly Encapsulate JDK Internals by Default
Antes
1 --illegal-access=permit
Ahora
1 --illegal-access=deny
44
Java 17
Java 17
306: Restoration of always-strict semantics for
floating-points
356: Pseudo-random number generators
improvements
382: Support for a new macOS pipeline for
rendering
391: The macOS AArch64 port
398: Deprecation of the infamous Applet API
with the goal of full removal
403: Strong encapsulation of Java’s internals
406: Switch pattern matching preview
407: RMI Activation removal
409: Full support for sealed Java classes
410: Removal of the experimental and largely
unused ahead-of-time (AOT) and just-in-time
(JIT) compilers
411: Deprecation of the Security Manager with
removal being the eventual goal
412: Incubation of the Foreign Function &
Memory API
414: Second incubation of the Vector API
415: Context-specific deserialization filters
45
406: Pattern Matching for switch (Preview)
1 static void testTriangle(Shape s) {
2 switch (s) {
3 case Triangle t && (t.calculateArea() > 100) ->
4 System.out.println("Large triangle");
5 case Square s ->
6 System.out.println("Is not a triangle is a square"
);
7 default ->
8 System.out.println("Non-triangle");
9 }
10 }
46
Nueva licencia Oracle Java 17
47
JEPs in JDK 17 integrated since JDK 11
https://openjdk.java.net/projects/jdk/17/jeps-since-jdk-11
48
Víctor Orozco
• vorozco@nabenik.com
• @tuxtor
• http://vorozco.com
• http://tuxtor.shekalug.org
This work is licensed under
Creative Commons Attribution-
NonCommercial-ShareAlike 3.0
Guatemala (CC BY-NC-SA 3.0 GT).
49

More Related Content

What's hot (20)

PPTX
Spring Boot and REST API
07.pallav
 
PDF
REST APIs with Spring
Joshua Long
 
PPT
Hibernate presentation
Manav Prasad
 
PPTX
Hibernate ppt
Aneega
 
PPTX
FS_module_functions.pptx
Bareen Shaikh
 
PDF
Building a fully managed stream processing platform on Flink at scale for Lin...
Flink Forward
 
PPTX
Introduction to java 8 stream api
Vladislav sidlyarevich
 
PDF
Formation Spring Avancé gratuite par Ippon 2014
Ippon
 
PDF
Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...
Edureka!
 
PPTX
java 8 new features
Rohit Verma
 
ODP
Java 9/10/11 - What's new and why you should upgrade
Simone Bordet
 
PDF
Introduction to Spring Boot!
Jakub Kubrynski
 
PDF
Introduction to Java 11
Knoldus Inc.
 
PDF
Spring Native and Spring AOT
VMware Tanzu
 
PDF
Java 8 Lambda Built-in Functional Interfaces
Ganesh Samarthyam
 
PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PPTX
Introduction to Spring Framework
Serhat Can
 
PDF
Hibernate Presentation
guest11106b
 
PPTX
Spring Boot
Jiayun Zhou
 
PDF
P2 éléments graphiques android
Lilia Sfaxi
 
Spring Boot and REST API
07.pallav
 
REST APIs with Spring
Joshua Long
 
Hibernate presentation
Manav Prasad
 
Hibernate ppt
Aneega
 
FS_module_functions.pptx
Bareen Shaikh
 
Building a fully managed stream processing platform on Flink at scale for Lin...
Flink Forward
 
Introduction to java 8 stream api
Vladislav sidlyarevich
 
Formation Spring Avancé gratuite par Ippon 2014
Ippon
 
Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...
Edureka!
 
java 8 new features
Rohit Verma
 
Java 9/10/11 - What's new and why you should upgrade
Simone Bordet
 
Introduction to Spring Boot!
Jakub Kubrynski
 
Introduction to Java 11
Knoldus Inc.
 
Spring Native and Spring AOT
VMware Tanzu
 
Java 8 Lambda Built-in Functional Interfaces
Ganesh Samarthyam
 
Introduction to Kubernetes Workshop
Bob Killen
 
Introduction to Spring Framework
Serhat Can
 
Hibernate Presentation
guest11106b
 
Spring Boot
Jiayun Zhou
 
P2 éléments graphiques android
Lilia Sfaxi
 

Similar to De Java 8 a Java 17 (20)

PDF
De Java 8 ate Java 14
Víctor Leonel Orozco López
 
PDF
De Java 8 a Java 11 y 14
Víctor Leonel Orozco López
 
PDF
Welcome, Java 15! (Japanese)
Logico
 
PDF
Tracing the Breadcrumbs: Apache Spark Workload Diagnostics
Databricks
 
PDF
Native Java with GraalVM
Sylvain Wallez
 
PPTX
DevNexus 2020: Discover Modern Java
Henri Tremblay
 
PDF
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
ThinkOpen
 
PPTX
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson
 
PDF
Updates from Project Hydrogen: Unifying State-of-the-Art AI and Big Data in A...
Databricks
 
PPTX
Relational Database Access with Python
Mark Rees
 
PPT
Best Practices for performance evaluation and diagnosis of Java Applications ...
IndicThreads
 
PPTX
Java
박 경민
 
PDF
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
Getting value from IoT, Integration and Data Analytics
 
PPTX
Java On Speed
Arto Santala
 
PDF
Java 40 versions_sgp
michaelisvy
 
PDF
ClojureScript for the web
Michiel Borkent
 
PPTX
Relational Database Access with Python ‘sans’ ORM
Mark Rees
 
PPTX
Java 9 new features
Masudul Haque
 
PDF
Apache Flink internals
Kostas Tzoumas
 
PPTX
How Opera Syncs Tens of Millions of Browsers and Sleeps Well at Night
ScyllaDB
 
De Java 8 ate Java 14
Víctor Leonel Orozco López
 
De Java 8 a Java 11 y 14
Víctor Leonel Orozco López
 
Welcome, Java 15! (Japanese)
Logico
 
Tracing the Breadcrumbs: Apache Spark Workload Diagnostics
Databricks
 
Native Java with GraalVM
Sylvain Wallez
 
DevNexus 2020: Discover Modern Java
Henri Tremblay
 
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
ThinkOpen
 
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson
 
Updates from Project Hydrogen: Unifying State-of-the-Art AI and Big Data in A...
Databricks
 
Relational Database Access with Python
Mark Rees
 
Best Practices for performance evaluation and diagnosis of Java Applications ...
IndicThreads
 
AMIS Oracle OpenWorld 2013 Review Part 3 - Fusion Middleware
Getting value from IoT, Integration and Data Analytics
 
Java On Speed
Arto Santala
 
Java 40 versions_sgp
michaelisvy
 
ClojureScript for the web
Michiel Borkent
 
Relational Database Access with Python ‘sans’ ORM
Mark Rees
 
Java 9 new features
Masudul Haque
 
Apache Flink internals
Kostas Tzoumas
 
How Opera Syncs Tens of Millions of Browsers and Sleeps Well at Night
ScyllaDB
 
Ad

More from Víctor Leonel Orozco López (20)

PDF
Introducción al análisis de datos
Víctor Leonel Orozco López
 
PDF
From traditional to GitOps
Víctor Leonel Orozco López
 
PDF
Iniciando microservicios reales con JakartaEE/MicroProfile y arquetipos de Maven
Víctor Leonel Orozco López
 
PDF
Desde la TV, hasta la nube, el ecosistema de Java en 26 años
Víctor Leonel Orozco López
 
PDF
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...
Víctor Leonel Orozco López
 
PDF
Tolerancia a fallas, service mesh y chassis
Víctor Leonel Orozco López
 
PDF
Explorando los objetos centrales de Kubernetes con Oracle Cloud
Víctor Leonel Orozco López
 
PDF
Introducción a GraalVM Native para aplicaciones JVM
Víctor Leonel Orozco López
 
PDF
Desarrollo moderno con DevOps y Cloud Native
Víctor Leonel Orozco López
 
PDF
Design Patterns para Microsserviços com MicroProfile
Víctor Leonel Orozco López
 
PDF
Gestión de proyectos con Maven
Víctor Leonel Orozco López
 
PDF
MicroProfile benefits for your monolithic applications
Víctor Leonel Orozco López
 
PDF
Actualizando aplicaciones empresariales en Java desde Java 8 on premise hasta...
Víctor Leonel Orozco López
 
PDF
Actualizando aplicaciones empresariales en Java desde Java 8 on premise hasta...
Víctor Leonel Orozco López
 
PDF
Consejos y el camino del desarrollador de software
Víctor Leonel Orozco López
 
PDF
Seguridad de aplicaciones Java/JakartaEE con OWASP Top 10
Víctor Leonel Orozco López
 
PDF
Introducción a Kotlin para desarrolladores Java
Víctor Leonel Orozco López
 
PDF
Programación con ECMA6 y TypeScript
Víctor Leonel Orozco López
 
PDF
Empaquetando aplicaciones Java con Docker y Kubernetes
Víctor Leonel Orozco López
 
PDF
MicroProfile benefits for monolitic applications
Víctor Leonel Orozco López
 
Introducción al análisis de datos
Víctor Leonel Orozco López
 
From traditional to GitOps
Víctor Leonel Orozco López
 
Iniciando microservicios reales con JakartaEE/MicroProfile y arquetipos de Maven
Víctor Leonel Orozco López
 
Desde la TV, hasta la nube, el ecosistema de Java en 26 años
Víctor Leonel Orozco López
 
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...
Víctor Leonel Orozco López
 
Tolerancia a fallas, service mesh y chassis
Víctor Leonel Orozco López
 
Explorando los objetos centrales de Kubernetes con Oracle Cloud
Víctor Leonel Orozco López
 
Introducción a GraalVM Native para aplicaciones JVM
Víctor Leonel Orozco López
 
Desarrollo moderno con DevOps y Cloud Native
Víctor Leonel Orozco López
 
Design Patterns para Microsserviços com MicroProfile
Víctor Leonel Orozco López
 
Gestión de proyectos con Maven
Víctor Leonel Orozco López
 
MicroProfile benefits for your monolithic applications
Víctor Leonel Orozco López
 
Actualizando aplicaciones empresariales en Java desde Java 8 on premise hasta...
Víctor Leonel Orozco López
 
Actualizando aplicaciones empresariales en Java desde Java 8 on premise hasta...
Víctor Leonel Orozco López
 
Consejos y el camino del desarrollador de software
Víctor Leonel Orozco López
 
Seguridad de aplicaciones Java/JakartaEE con OWASP Top 10
Víctor Leonel Orozco López
 
Introducción a Kotlin para desarrolladores Java
Víctor Leonel Orozco López
 
Programación con ECMA6 y TypeScript
Víctor Leonel Orozco López
 
Empaquetando aplicaciones Java con Docker y Kubernetes
Víctor Leonel Orozco López
 
MicroProfile benefits for monolitic applications
Víctor Leonel Orozco López
 
Ad

Recently uploaded (20)

PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
July Patch Tuesday
Ivanti
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Biography of Daniel Podor.pdf
Daniel Podor
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 

De Java 8 a Java 17

  • 1. Desde Java 8 hasta Java 17 Víctor Orozco - @tuxtor 5 de octubre de 2021 Nabenik 1
  • 2. ¿Como se hace Java? De Java 8 hasta Java 17 Java 9 Java 10 Java 11 Java 12 Java 13 Java 14 Java 15 Java 16 Java 17 2
  • 4. ¿Java? • Lenguaje • VM • Bibliotecas/API El conjunto es la plataforma Java (TM) 3
  • 5. ¿Como se actualiza Java? • JCP - Java Community Process • JSR - Java Specification Request • JEP - Java Enhancement Proposal • JCK - Java Compatibility Kit 4
  • 6. ¿Como se actualiza Java? - Java Enhancement Proposal 5
  • 7. ¿Como se actualiza Java? - Java Compatibility Kit 6
  • 9. De Java 8 hasta Java 17
  • 10. ¿Que versión de Java se usa más en Guatemala? Java 8 https://guatejug.github.io/jvm2021/ 8
  • 11. ¿Que recibo con cada versión nueva de Java? • Java - Lenguaje • Java - Bibliotecas e APIs • Java - Maquina Virtual de Java Mejoras de tipo • Incubation • Preview (–flag) • Definitiva 9
  • 12. Java - Las mejoras que resaltan • Java 9 • Modulos • JShell • HTTP/2 • Factory methods • Java 10 • Type Inference • Class Data Sharing • Time based release • Java 11 • String methods • File methods • Direct .java execution • Java 12 • Switch expressions • Java 13 • Text blocks • Java 14 • Pattern matching • Records • Helpfull NPE 10
  • 13. Java - Las mejoras que resaltan • Java 15 • Sealed classes • Nashorn removal • SPARC/Solaris removal • Java 16 • Vector API (Incubator) • C++ 14 • Records • Java 17 • MacOS Metal • Strong encapsulation • Switch expression + pattern matching • AOT removal • Applet deprecation 11
  • 15. JEP 222: jshell: The Java Shell (Read-Eval-Print Loop) 12
  • 16. JEP 110: HTTP/2 Client 1 HttpRequest request = HttpRequest.newBuilder() 2 .uri(new URI("https://swapi.co/api/starships/9")) 3 .GET() 4 .build(); 5 6 HttpResponse<String> response = HttpClient.newHttpClient() 7 .send(request, BodyHandlers.ofString()); 8 9 System.out.println(response.body()); 13
  • 17. JEP 269: Convenience Factory Methods for Collections Antes 1 Set<String> set = new HashSet<>(); 2 set.add("a"); 3 set.add("b"); 4 set.add("c"); 5 set = Collections.unmodifiableSet(set); ”Pro” 1 Set<String> set = Collections.unmodifiableSet(new HashSet<>( Arrays.asList("a", "b", "c"))); Ahora 1 Set<String> set = Set.of("a", "b", "c"); 14
  • 18. JEP 213: Milling Project Coin - Private methods in interfaces Antes 1 public interface Vehicle{ 2 public void move(); 3 } Ahora 1 public interface Vehicle{ 2 public default void makeNoise(){ 3 System.out.println("Making noise!"); 4 createNoise(); 5 } 6 7 private void createNoise(){ 8 System.out.println("Run run"); 9 } 10 } 15
  • 19. JEP 213: Milling Project Coin - Try-with-resources Antes 1 BufferedReader reader = new BufferedReader(new FileReader(" langs.txt")); 2 3 try(BufferedReader innerReader = reader){ 4 System.out.println(reader.readLine()); 5 } Ahora 1 BufferedReader reader = new BufferedReader(new FileReader(" langs.txt")); 2 3 try(reader){ 4 System.out.println(reader.readLine()); 5 } 16
  • 21. Java 10 286: Local-Variable Type Inference 296: Consolidate the JDK Forest into a Single Repository 304: Garbage-Collector Interface 307: Parallel Full GC for G1 310: Application Class-Data Sharing 312: Thread-Local Handshakes 313: Remove the Native-Header Generation Tool (javah) 314: Additional Unicode Language-Tag Extensions 316: Heap Allocation on Alternative Memory Devices 317: Experimental Java-Based JIT Compiler 319: Root Certificates 322: Time-Based Release Versioning 17
  • 22. JEP 286: Local-Variable Type Inference 1 public static void main(String args[]){ 2 var localValue = 99; 3 System.out.println(++localValue); 4 //localValue = "Foo" 5 } 18
  • 23. JEP 310: Application Class-Data Sharing 1 java −XX:+UseAppCDS −XX : DumpLoadedClassList=classes . l s t − j a r demo−microservicio − ee−microbundle . j a r 2 java −XX:+UseAppCDS −Xshare :dump −XX : SharedClassListFile =classes . l s t −XX : SharedArchiveFile=app−cds . jsa demo−microservicio −ee−microbundle . j a r 3 java −XX:+UseAppCDS −Xshare : on −XX : SharedArchiveFile=app−cds . jsa − j a r demo− microservicio −ee−microbundle . j a r 19
  • 24. JEP 310: Application Class-Data Sharing 20
  • 25. JEP 310: Application Class-Data Sharing 21
  • 26. JEP 322: Time-Based Release Versioning 22
  • 27. JEP 322: Time-Based Release Versioning 23
  • 29. Java 11 181: Nest-Based Access Control 309: Dynamic Class-File Constants 315: Improve Aarch64 Intrinsics 318: Epsilon: A No-Op Garbage Collector 320: Remove the Java EE and CORBA Modules 321: HTTP Client (Standard) 323: Local-Variable Syntax for Lambda Parameters 324: Key Agreement with Curve25519 and Curve448 327: Unicode 10 328: Flight Recorder 329: ChaCha20 and Poly1305 Cryptographic Algorithms 330: Launch Single-File Source-Code Programs 331: Low-Overhead Heap Profiling 332: Transport Layer Security (TLS) 1.3 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental) 335: Deprecate the Nashorn JavaScript Engine 336: Deprecate the Pack200 Tools and API 24
  • 30. JEP 323: Local-Variable Syntax for Lambda Parameters Antes 1 BiPredicate<String,String> demoPredicate = 2 (String a, String b) -> a.equals(b); 3 BiPredicate<String,String> demoPredicate = 4 (a, b) -> a.equals(b); Ahora 1 BiPredicate<String,String> demoPredicate = 2 (var a, var b) -> a.equals(b); Posibilidades 1 (@Nonnull var x, @Nullable var y) -> x.process(y) 25
  • 31. JEP 330: Launch Single-File Source-Code Programs 26
  • 33. Java 12 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental) 230: Microbenchmark Suite 325: Switch Expressions (Preview) 334: JVM Constants API 340: One AArch64 Port, Not Two 341: Default CDS Archives 344: Abortable Mixed Collections for G1 346: Promptly Return Unused Committed Memory from G1 27
  • 34. 325: Switch Expressions (Preview) Antes 1 String langType = ""; 2 switch (args[0]) { 3 case "Java": 4 case "Scala": 5 case "Kotlin": 6 langType = "Static typed"; 7 break; 8 case "Groovy": 9 case "JavaScript": 10 langType = "Dynamic typed"; 11 break; 12 } 13 System.out.println(langType); 28
  • 35. 325: Switch Expressions (Preview) Ahora 1 String langType = switch (args[0]) { 2 case "Java", "Scala", "Kotlin" -> "Static typed"; 3 case "Groovy", "JavaScript" -> "Dynamic typed"; 4 default -> { 5 System.out.println("This meant to be a processing block"); 6 yield "Probably LISP :)"; 7 } 8 }; 9 System.out.println(langType); 29
  • 37. Java 13 350: Dynamic CDS Archives 351: ZGC: Uncommit Unused Memory 353: Reimplement the Legacy Socket API 354: Switch Expressions (Preview) 355: Text Blocks (Preview) 30
  • 38. 355: Text Blocks (Preview) Antes 1 String html = "<html>n" + 2 " <body>n" + 3 " <p>Hello, world</p>n" + 4 " </body>n" + 5 "</html>n"; Ahora 1 String html = """ 2 <html> 3 <body> 4 <p>Hello, world</p> 5 </body> 6 </html> 7 """; 31
  • 40. Java 14 305: Pattern Matching for instanceof (Preview) 343: Packaging Tool (Incubator) 345: NUMA-Aware Memory Allocation for G1 349: JFR Event Streaming 352: Non-Volatile Mapped Byte Buffers 358: Helpful NullPointerExceptions 359: Records (Preview) 361: Switch Expressions (Standard) 362: Deprecate the Solaris and SPARC Ports 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector 364: ZGC on macOS 365: ZGC on Windows 366: Deprecate the ParallelScavenge + SerialOld GC Combination 367: Remove the Pack200 Tools and API 368: Text Blocks (Second Preview) 370: Foreign-Memory Access API (Incubator) 32
  • 41. JEP 359: Records (Preview) Data carrier 1 record Person(String name, String email, int age) {} Uso 1 Person foo = new Person("Marco", "[email protected]",99); 2 System.out.println(foo); 3 //foo.name = "Polo"; 33
  • 42. 305: Pattern Matching for instanceof (Preview) Antes 1 if(o instanceof Person){ 2 Person p = (Person)o; 3 System.out.println("Hello " + p.name()); 4 }else{ 5 System.out.println("Unknown object"); 6 } Ahora 1 if(o instanceof Person p){ 2 System.out.println("Hello " + p.name()); 3 }else{ 4 System.out.println("Unknown object"); 5 } 34
  • 44. Java 15 339: Addition of EdDSA (Edwards-Curve Digital Signature Algorithm) 360: Preview for sealed classes 371: Addition of hidden classes in Java 372: Removal of the Nashorn JavaScript Engine 373: Legacy DatagramSocket API reimplementation 374: Biased locking disablement and deprecation 375: Second preview for instanceof pattern matching 377: Addition of ZGC, the scalable, low-latency, garbage collector for Java 378: Full inclusion of Java Text Blocks 379: Addition and enhancements of the low-pause time Shenandoah garbage collector 381: Final remove of Solaris and SPARC Ports 383: Incubation of the Foreign-Memory Access API 384: Second preview inclusion of Java Records 385: RMI Activation deprecation with the goal of future removal 35
  • 45. 360: Sealed Classes (Preview) Antes 1 public class Animal { ... } 2 3 public class Porsche extends Animal { ... } Ahora 1 public abstract sealed class Animal 2 permits Dog, Cat, Wolf { ... } 36
  • 46. 360: Sealed Classes (Preview) Antes 1 public class Animal { ... } 2 3 public class Porsche extends Animal { ... } Pro 1 abstract sealed class Animal { 2 final class Dog extends Root { ... } 3 final class Cat extends Root { ... } 4 final class Wolf extends Root { ... } 5 ... } 37
  • 47. 371: Hidden Classes Antes 1 ClassLoader::defineClass Ahora 1 Lookup::defineHiddenClass 38
  • 48. 381: Remove the Solaris and SPARC Ports 39
  • 49. 383: Foreign-Memory Access API (Second Incubator) 1 VarHandle intHandle = MemoryHandles.varHandle(int.class, 2 ByteOrder.nativeOrder()); 3 4 try (MemorySegment segment = MemorySegment.allocateNative(100) ) { 5 for (int i = 0; i < 25; i++) { 6 intHandle.set(segment, i * 4, i); 7 } 8 ... 40
  • 51. Java 16 338: Incubation of the Vector API 347: C++14 language features enablement 357: Migration from Mercurial to Git 369: GitHub migration of OpenJDK repositories 376: Concurrent thread-stack processing for ZGC 380: Unix-Domain Socket Channels 386: Alpine Linux port 387: Support for elastic metaspace 388: The Windows AArch64 Port 389: Incubation of the Foreign Linker API 390: Value-based classes warnings 392: Addition of the Packaging Tool 393: Third incubation of the Foreign-Memory Access API 394: Full inclusion of pattern matching for instanceof 395: Full implementation of Java Records 396: Strongly encapsulation of JDK Internals 397: Second preview of sealed classes 41
  • 52. 386: Alpine Linux Port 42
  • 53. 389: Foreign Linker API (Incubator) 1 LibraryLookup libclang = LibraryLookup.ofLibrary("clang"); 2 LibraryLookup.Symbol clangVersion = libclang.lookup(" clang_getClangVersion"); 43
  • 54. 396: Strongly Encapsulate JDK Internals by Default Antes 1 --illegal-access=permit Ahora 1 --illegal-access=deny 44
  • 56. Java 17 306: Restoration of always-strict semantics for floating-points 356: Pseudo-random number generators improvements 382: Support for a new macOS pipeline for rendering 391: The macOS AArch64 port 398: Deprecation of the infamous Applet API with the goal of full removal 403: Strong encapsulation of Java’s internals 406: Switch pattern matching preview 407: RMI Activation removal 409: Full support for sealed Java classes 410: Removal of the experimental and largely unused ahead-of-time (AOT) and just-in-time (JIT) compilers 411: Deprecation of the Security Manager with removal being the eventual goal 412: Incubation of the Foreign Function & Memory API 414: Second incubation of the Vector API 415: Context-specific deserialization filters 45
  • 57. 406: Pattern Matching for switch (Preview) 1 static void testTriangle(Shape s) { 2 switch (s) { 3 case Triangle t && (t.calculateArea() > 100) -> 4 System.out.println("Large triangle"); 5 case Square s -> 6 System.out.println("Is not a triangle is a square" ); 7 default -> 8 System.out.println("Non-triangle"); 9 } 10 } 46
  • 58. Nueva licencia Oracle Java 17 47
  • 59. JEPs in JDK 17 integrated since JDK 11 https://openjdk.java.net/projects/jdk/17/jeps-since-jdk-11 48
  • 60. Víctor Orozco • [email protected] @tuxtor • http://vorozco.com • http://tuxtor.shekalug.org This work is licensed under Creative Commons Attribution- NonCommercial-ShareAlike 3.0 Guatemala (CC BY-NC-SA 3.0 GT). 49