SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Taste of new in
Java 9
Arkadiusz Sokołowski
2015
Agenda
● A bit of history
● jshell
● JDK Benchmarks / jmh
● small stuff...
● jigsaw
● what’s beyond 9?
Bit of history
1991: Green (Oak)
1994: JDK EAs
Jan 1996: JDK 1.0
Feb 1997: JDK 1.1
Dec 1998: J2SE 1.2
May 2000: J2SE 1.3
Feb 2002: J2SE 1.4
Sep 2004: J2SE 5.0
Dec 2006: Java SE 6
Jul 2011: Java SE 7
Mar 2014: Java SE 8
Sep 2016: Java SE 9
release
Dec 2015: Java SE 9
feature complete
New versioning scheme
● Current scheme:
○ Minor releases containing changes beyond security
fixes are multiples of 20
○ Security releases based on the previous minor
release are odd numbers incremented by five, or by
six if necessary in order to keep the update number
odd
New versioning scheme
● New scheme:
○ MAJOR.MINOR.SECURITY
○ 1.8.0 => 8.0.0
○ 1.8.0_05 => 8.0.1
○ 1.8.0_11 => 8.0.2
○ 1.8.0_20 => 8.1.2
○ 1.8.0_25 => 8.1.3
jshell
JDK Benchmark Suite
● based on JMH
● stable, tuned benchmarks
● targeted for continuous performance check
● lot of benchmarks for standard libraries
● comparison with JDK 8
Http/2
HttpResponse response = HttpRequest
.create(new URI("http://www.ocado.com"))
.body(noBody())
.GET().send();
int responseCode = response.responseCode();
String responseBody = response.body(asString());
System.out.println(responseBody);
Http/2
HttpRequest req = HttpRequest
.create(new URI("http://www.ocado.com"))
.body(noBody())
.GET();
CompletableFuture<HttpResponse> asyncResp = req.sendAsync();
Thread.sleep(10);
if (!asyncResp.isDone()) {
asyncResp.cancel(true);
System.err.println("timeout");
return;
}
HttpResponse response = asyncResp.get();
Unified JVM logging
● usage: -Xlog[:option]
● tags (GC, HTTP, security, …)
● levels (error, warning, info, debug, trace)
● decorators (time, uptime, pid, tid, level, tag)
● output (can be rotated file!)
● -Xlog:gc=debug:file=gc.txt:uptime,level
Coin project - language adjustments
● allow @SaveVargs on private instance methods
● allow effectively-final variables in try-with-resources
● more type inference with generics
● underscore will be no more a valid identifier
● private methods in interfaces
Hotspot / JDK diagnostics
● print_class_summary
● print_codegen_list
● print_utf8pool
● dump_codelist
● print_codeblocks
● set_vmflags
Other...
● improved contented locking
● variable handles (Unsafe!)
● sjavac
● fixed imports processing by javac
● Security (Datagram / Application transport layer)
● HTML5 javadoc
● Unicode 8.0
Other...
● String internal representation altered
● Java-Level JVM Compiler Interface
● Parser API for Nashorn
● Support for AArch64 (ARMv8) architecture
● Compile for Older Platform Versions
● G1 will be default garbage collector
● Store Interned Strings in CDS archives
Jigsaw - modules for Java
● Motivation:
○ JAR/classpath hell reduction
○ manual dependencies management
○ unexpressed/transitive dependencies
○ hide some (private) packages; com.sun.misc.*
○ system instead of manual security
○ JRE size reduction
Copyright © Oracle 2015
Jigsaw - modules in Java8
Copyright © Oracle 2015
Jigsaw - piece of action...
Jigsaw - one more example
module com.foo.app {
requires com.foo.bar;
requires java.sql;
}
module java.sql {
requires java.logging;
requires java.xml;
exports java.sql;
exports javax.sql;
exports javax.transaction.xa;
}
Jigsaw - one more example
Copyright © Oracle 2015
Jigsaw - implied readability
String url = ...;
Properties props = ...;
Driver d = DriverManager.getDriver(url);
Connection c = d.connect(url, props);
d.getParentLogger().info("Connection acquired");
Jigsaw - implied readability
module java.sql {
requires public java.logging;
requires public java.xml;
exports java.sql;
exports javax.sql;
exports javax.transaction.xa;
}
Jigsaw - implied readability
Copyright © Oracle 2015
Jigsaw - services
module com.mysql.jdbc {
requires java.sql;
requires org.slf4j;
exports com.mysql.jdbc;
}
Jigsaw - services
module java.sql {
requires public java.logging;
requires public java.xml;
exports java.sql;
exports javax.sql;
exports javax.transaction.xa;
uses java.sql.Driver;
}
Jigsaw - services
module com.mysql.jdbc {
requires java.sql;
requires org.slf4j;
exports com.mysql.jdbc;
provides java.sql.Driver with com.mysql.jdbc.Driver;
}
Jigsaw - services
Copyright © Oracle 2015
Jigsaw - qualified exports
module java.base {
...
exports sun.reflect to
java.corba,
java.logging,
java.sql,
java.sql.rowset,
jdk.scripting.nashorn;
}
Jigsaw - qualified exports
Copyright © Oracle 2015
Java 10: value classes
value class Point {
int x;
int y;
Point(int x, int y) {
this.x = x;
this.y = y;
}
}
Java 10: generics
● Reified Generics
● Generics with values
List<int> intList = new ArrayList<>();
…
int val = intList.get(0);
List<Point>... List$Point,
Thank you!
...questions?

Weitere ähnliche Inhalte

Andere mochten auch

JDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
JDD2015: Panta rhei or Reactive Java in practice - Tomasz KowalczewskiJDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
JDD2015: Panta rhei or Reactive Java in practice - Tomasz KowalczewskiPROIDEA
 
JDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz Sieraczkiewicz
JDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz SieraczkiewiczJDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz Sieraczkiewicz
JDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz SieraczkiewiczPROIDEA
 
JDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiJDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiPROIDEA
 
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...PROIDEA
 
JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak
JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak
JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak PROIDEA
 
JDD2015: -XX:+UseG1GC - Jakub Kubryński
JDD2015: -XX:+UseG1GC - Jakub KubryńskiJDD2015: -XX:+UseG1GC - Jakub Kubryński
JDD2015: -XX:+UseG1GC - Jakub KubryńskiPROIDEA
 

Andere mochten auch (6)

JDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
JDD2015: Panta rhei or Reactive Java in practice - Tomasz KowalczewskiJDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
JDD2015: Panta rhei or Reactive Java in practice - Tomasz Kowalczewski
 
JDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz Sieraczkiewicz
JDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz SieraczkiewiczJDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz Sieraczkiewicz
JDD2015: Trudne Rozmowy [WORKSHOP] - Mariusz Sieraczkiewicz
 
JDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiJDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof Dębski
 
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
 
JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak
JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak
JDD 2015: Artificial intelligence. Status report. - Tomasz Jackowiak
 
JDD2015: -XX:+UseG1GC - Jakub Kubryński
JDD2015: -XX:+UseG1GC - Jakub KubryńskiJDD2015: -XX:+UseG1GC - Jakub Kubryński
JDD2015: -XX:+UseG1GC - Jakub Kubryński
 

Ähnlich wie JDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski

Java 9-10 What's New
Java 9-10 What's NewJava 9-10 What's New
Java 9-10 What's NewNicola Pedot
 
Prepare for JDK 9
Prepare for JDK 9Prepare for JDK 9
Prepare for JDK 9haochenglee
 
QConSP 2018 - Java Module System
QConSP 2018 - Java Module SystemQConSP 2018 - Java Module System
QConSP 2018 - Java Module SystemLeonardo Zanivan
 
Java and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemJava and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemRafael Winterhalter
 
Jozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 UnconferenceJozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 UnconferenceHeather VanCura
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Rikard Thulin
 
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"GlobalLogic Ukraine
 
Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12Rory Preddy
 
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)Kaunas Java User Group
 
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]Leonardo Zanivan
 
Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)Simone Bordet
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiSoftware Guru
 
A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)Markus Günther
 
Nw installation
Nw installationNw installation
Nw installationdkeerthan
 
Java 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgradeJava 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgradeSimone Bordet
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youDmitry Buzdin
 

Ähnlich wie JDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski (20)

Java 9-10 What's New
Java 9-10 What's NewJava 9-10 What's New
Java 9-10 What's New
 
Prepare for JDK 9
Prepare for JDK 9Prepare for JDK 9
Prepare for JDK 9
 
Java 9 and Project Jigsaw
Java 9 and Project JigsawJava 9 and Project Jigsaw
Java 9 and Project Jigsaw
 
QConSP 2018 - Java Module System
QConSP 2018 - Java Module SystemQConSP 2018 - Java Module System
QConSP 2018 - Java Module System
 
Java and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemJava and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystem
 
Jozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 UnconferenceJozi-JUG JDK 9 Unconference
Jozi-JUG JDK 9 Unconference
 
Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4Jigsaw - Javaforum 2015Q4
Jigsaw - Javaforum 2015Q4
 
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
 
Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12
 
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
 
Java History and Trends
Java History and TrendsJava History and Trends
Java History and Trends
 
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
 
Java Programming - 01 intro to java
Java Programming - 01 intro to javaJava Programming - 01 intro to java
Java Programming - 01 intro to java
 
Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
 
A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)A Journey through the JDKs (Java 9 to Java 11)
A Journey through the JDKs (Java 9 to Java 11)
 
Nw installation
Nw installationNw installation
Nw installation
 
Java 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgradeJava 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgrade
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for you
 
Java modules using project jigsaw@jdk 9
Java modules using project jigsaw@jdk 9Java modules using project jigsaw@jdk 9
Java modules using project jigsaw@jdk 9
 

Kürzlich hochgeladen

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Kürzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

JDD2015: Taste of new in Java 9 - Arkadiusz Sokołowski

  • 1. Taste of new in Java 9 Arkadiusz Sokołowski 2015
  • 2. Agenda ● A bit of history ● jshell ● JDK Benchmarks / jmh ● small stuff... ● jigsaw ● what’s beyond 9?
  • 3. Bit of history 1991: Green (Oak) 1994: JDK EAs Jan 1996: JDK 1.0 Feb 1997: JDK 1.1 Dec 1998: J2SE 1.2 May 2000: J2SE 1.3 Feb 2002: J2SE 1.4 Sep 2004: J2SE 5.0 Dec 2006: Java SE 6 Jul 2011: Java SE 7 Mar 2014: Java SE 8 Sep 2016: Java SE 9 release Dec 2015: Java SE 9 feature complete
  • 4. New versioning scheme ● Current scheme: ○ Minor releases containing changes beyond security fixes are multiples of 20 ○ Security releases based on the previous minor release are odd numbers incremented by five, or by six if necessary in order to keep the update number odd
  • 5. New versioning scheme ● New scheme: ○ MAJOR.MINOR.SECURITY ○ 1.8.0 => 8.0.0 ○ 1.8.0_05 => 8.0.1 ○ 1.8.0_11 => 8.0.2 ○ 1.8.0_20 => 8.1.2 ○ 1.8.0_25 => 8.1.3
  • 7. JDK Benchmark Suite ● based on JMH ● stable, tuned benchmarks ● targeted for continuous performance check ● lot of benchmarks for standard libraries ● comparison with JDK 8
  • 8. Http/2 HttpResponse response = HttpRequest .create(new URI("http://www.ocado.com")) .body(noBody()) .GET().send(); int responseCode = response.responseCode(); String responseBody = response.body(asString()); System.out.println(responseBody);
  • 9. Http/2 HttpRequest req = HttpRequest .create(new URI("http://www.ocado.com")) .body(noBody()) .GET(); CompletableFuture<HttpResponse> asyncResp = req.sendAsync(); Thread.sleep(10); if (!asyncResp.isDone()) { asyncResp.cancel(true); System.err.println("timeout"); return; } HttpResponse response = asyncResp.get();
  • 10. Unified JVM logging ● usage: -Xlog[:option] ● tags (GC, HTTP, security, …) ● levels (error, warning, info, debug, trace) ● decorators (time, uptime, pid, tid, level, tag) ● output (can be rotated file!) ● -Xlog:gc=debug:file=gc.txt:uptime,level
  • 11. Coin project - language adjustments ● allow @SaveVargs on private instance methods ● allow effectively-final variables in try-with-resources ● more type inference with generics ● underscore will be no more a valid identifier ● private methods in interfaces
  • 12. Hotspot / JDK diagnostics ● print_class_summary ● print_codegen_list ● print_utf8pool ● dump_codelist ● print_codeblocks ● set_vmflags
  • 13. Other... ● improved contented locking ● variable handles (Unsafe!) ● sjavac ● fixed imports processing by javac ● Security (Datagram / Application transport layer) ● HTML5 javadoc ● Unicode 8.0
  • 14. Other... ● String internal representation altered ● Java-Level JVM Compiler Interface ● Parser API for Nashorn ● Support for AArch64 (ARMv8) architecture ● Compile for Older Platform Versions ● G1 will be default garbage collector ● Store Interned Strings in CDS archives
  • 15. Jigsaw - modules for Java ● Motivation: ○ JAR/classpath hell reduction ○ manual dependencies management ○ unexpressed/transitive dependencies ○ hide some (private) packages; com.sun.misc.* ○ system instead of manual security ○ JRE size reduction
  • 17. Jigsaw - modules in Java8 Copyright © Oracle 2015
  • 18. Jigsaw - piece of action...
  • 19. Jigsaw - one more example module com.foo.app { requires com.foo.bar; requires java.sql; } module java.sql { requires java.logging; requires java.xml; exports java.sql; exports javax.sql; exports javax.transaction.xa; }
  • 20. Jigsaw - one more example Copyright © Oracle 2015
  • 21. Jigsaw - implied readability String url = ...; Properties props = ...; Driver d = DriverManager.getDriver(url); Connection c = d.connect(url, props); d.getParentLogger().info("Connection acquired");
  • 22. Jigsaw - implied readability module java.sql { requires public java.logging; requires public java.xml; exports java.sql; exports javax.sql; exports javax.transaction.xa; }
  • 23. Jigsaw - implied readability Copyright © Oracle 2015
  • 24. Jigsaw - services module com.mysql.jdbc { requires java.sql; requires org.slf4j; exports com.mysql.jdbc; }
  • 25. Jigsaw - services module java.sql { requires public java.logging; requires public java.xml; exports java.sql; exports javax.sql; exports javax.transaction.xa; uses java.sql.Driver; }
  • 26. Jigsaw - services module com.mysql.jdbc { requires java.sql; requires org.slf4j; exports com.mysql.jdbc; provides java.sql.Driver with com.mysql.jdbc.Driver; }
  • 27. Jigsaw - services Copyright © Oracle 2015
  • 28. Jigsaw - qualified exports module java.base { ... exports sun.reflect to java.corba, java.logging, java.sql, java.sql.rowset, jdk.scripting.nashorn; }
  • 29. Jigsaw - qualified exports Copyright © Oracle 2015
  • 30. Java 10: value classes value class Point { int x; int y; Point(int x, int y) { this.x = x; this.y = y; } }
  • 31. Java 10: generics ● Reified Generics ● Generics with values List<int> intList = new ArrayList<>(); … int val = intList.get(0); List<Point>... List$Point,