2015 Java update and roadmap, JUG sevilla
-
Upload
trisha-gee -
Category
Technology
-
view
7.060 -
download
2
Transcript of 2015 Java update and roadmap, JUG sevilla
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java Update and Roadmap Jan 2015
Georges Saab Vice President SoFware Development Aurelio Garcia-‐Ribeyro Principal Group Product Manager Java SE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement The following is intended to outline our general product direcQon. It is intended for informaQon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funcQonality, and should not be relied upon in making purchasing decisions. The development, release, and Qming of any features or funcQonality described for Oracle’s products remains at the sole discreQon of Oracle.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Agenda
Oracle and Java
Java SE 8 Overview
Java SE 9 and Beyond
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle and Java
Java SE 8 Overview
Roadmap
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle and Java
• Oracle has used Java since the beginning of Qme (eg 1990s) • Acquired JAVA (Sun Microsystems) in 2010, including Java IP, trademarks • Embraced OpenJDK, open community, open JCP
– Welcomed IBM, Apple, SAP, ARM, AMD, Intel, Twi]er, Goldman Sachs, MicrosoF and many others – Made OpenJDK official Java SE reference implementaQon – Ongoing move towards open development, governance, transparency
• JDK development: Oracle and community – Oracle focus on modernizaQon, security, big Qcket R&D and commercial value to Oracle – Community contributes based on interest and ability, examples:
• Doug Lea (concurrency, memory model), Stephen Colebourne (date/Qme), Michael Ernst (type annotaQons) • IBM and SAP (PPC port), CPU manufacturers (opQmizaQons), OS vendors (ports, integraQon and opQmizaQons) • JUGs: adopt-‐OpenJDK, adopt-‐a-‐JSR
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle and Java
Java SE 8 Overview
Roadmap
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java 8 “One of the biggest updates ever to a major language” Andrew Binstock, Editor in Chief, Dr.Dobbs
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java 8 Features Innova.on • Lambda aka Closures • Language Interop • Nashorn
Core Libraries • Parallel operaQons for core
collecQons APIs • Improvements in funcQonality • Improved type inference
General Goodness • JVM enhancements • No PermGen limitaQons • Performance improvements
Java for Everyone • Profiles for constrained devices • JSR 310-‐Date & Time APIs • Non-‐Gregorian calendars • Unicode 6.2 • ResourceBundle • BCP47 locale matching • GlobalizaQon & Accessibility
Tools • JSR 308-‐AnnotaQons on Java Type • RepeaQng AnnotaQons • Java Dependency Analysis Tool • App Store packaging tool (8u20)
Client • Deployment enhancements • JavaFX 8 • Public UI Control API • Java SE Embedded support • Enhanced HTML5 support • 3D shapes and a]ributes • PrinQng
Security • Limited doPrivilege • NSA Suite B algorithm support • SNI Server Side support • DSA updated to FIPS186-‐3 • AEAD JSSE CipherSuites
Enterprise • Mission Control 5.3 • Flight Recorder • Usage Tracker • Advanced Mgmt Console (8u20) • MSI JRE Installer (8u20)
9
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Lambda Expressions
• A lambda expression (closure) is an anonymous method – Has an argument list, a return type, and a body
(Object o) -> o.toString() – Can refer to values from the enclosing lexical scope
(Person p) -> p.getName().equals(name)
• A method reference is a reference to an exisQng method Object::toString
• Allow you to treat code as data – Behavior can be stored in variables and passed to methods
(Anonymous inner classes done right)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Streams
• A sequence of elements supporQng sequenQal and parallel aggregate operaQons.
• Concerned with declaraQvely describing a. their source, and b. The operaQons which will be performed on that source
• To perform a computaQon, stream operaQons are composed into a stream pipeline
• …which may execute either sequenQally or in parallel
java.uQl.stream
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Example: Lambda FuncQons and Streams
Set<Seller> sellers = new HashSet<>(); for (Txn t : txns) { if (t.getBuyer().getAge() >= 65) sellers.add(t.getSeller()); } List<Seller> sorted = new ArrayList<>(sellers); Collections.sort(sorted, new Comparator<Group>() { public int compare(Seller a, Seller b) { return a.getName().compareTo(b.getName()); } }); for (Seller s : sorted) System.out.println(s.getName());
“Print the name of every unique person selling to someone who is at least
65 years old”
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Example: Lambda FuncQons and Streams
txns.stream() .filter(t -> t.getBuyer().getAge() >= 65) .map(Txn::getSeller) .distinct() .sort(comparing(Seller::getName)) .forEach(s -> System.out.println(s.getName());
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Example: Lambda FuncQons and Streams
txns.stream() .parallel() .filter(t -> t.getBuyer().getAge() >= 65) .map(Txn::getSeller) .distinct() .sort(comparing(Seller::getName)) .forEach(s -> System.out.println(s.getName());
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Example: StaQc and Default Methods in Interfaces public interface TimeClient { void setTime(int hour, int minute, int second); void setDate(int day, int month, int year); void setDateAndTime(int day, int month, int year, int hour, int minute, int second); LocalDateTime getLocalDateTime(); static ZoneId getZoneId (String zoneString) { try { return ZoneId.of(zoneString); } catch (DateTimeException e) { System.err.println("Invalid time zone: " + zoneString + "; using default time zone instead."); return ZoneId.systemDefault(); } } default ZonedDateTime getZonedDateTime (String zoneString) { return ZonedDateTime.of(getLocalDateTime(), getZoneId(zoneString)); } }
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Nashorn JavaScript Engine
• “Pure Java” Java Script Engine, replaces Rhino • ECMAScript 5.1 compliant • OpQmized for and with Invokedynamic (JSR-‐292) • Invoke from Java code or command line (jjs) • Simple access to Java classes and objects from JS code • Integrates with JavaFX 8
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Example: Invoking JS from Java public class EvalScript { public static void main(String[] args) throws Exception { // create a script engine manager ScriptEngineManager factory = new ScriptEngineManager(); // create a Nashorn script engine ScriptEngine engine = factory.getEngineByName("nashorn"); // evaluate JavaScript statement try { engine.eval("print('Hello, World!');"); } catch (final ScriptException se) { se.printStackTrace(); } } }
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Example: Accessing Java from JS var Run = Java.type("java.lang.Runnable"); var MyRun = Java.extend(Run, { run: function() { print("Run in separate thread"); } }); var Thread = Java.type("java.lang.Thread"); var th = new Thread(new MyRun());
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java Date/Time Features – JSR 310
• Fluent, Immutable, Thread Safe, Easy to use • Strong typing with fit for purpose types • Easy to use formaqng and parsing
• Interoperable with java.uQl.Calendar/Date • Extensible Units, Fields, and Chronologies • Supports Regional Calendars • DatePicker support in JavaFX • Supported by JDBC, java.sql.Date/Time/Timestamp
• The essenQal ISO Calendar for global business
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Other InternaQonalizaQon Enhancements Feature Benefit
Unicode 6.2 Improved support for languages/scripts used in Asia, Africa and the Middle East
Custom resource bundles Enables easy extension with custom/specialized locales
Common Locale Data Repository (CLDR) support
Enables use of CLDR locale service providers
BCP 47 locale matching Enables matching of applicaQon locale to user preferences
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JavaFX 8
• New Modern Theme: Modena • Enhancements to CollecQons, Bindings, Tasks and Services • Full screen improvements, new unified stage style, rich text and prinQng • Embed Swing in JavaFX applicaQons • DatePicker and TreeTableViews • Public API for CSS structure • WebView enhancements (Web Sockets, Web Workers, Web Fonts) • JavaFX 3D • MulQ-‐touch (introduced in 7, relevant in 8) • Hi-‐DPI (ReQna) display support
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
AnnotaQons & Developer Tools
• AnnotaQons on Java Types (JSR-‐308) – Enabled through type checking frameworks such ashFp://types.cs.washington.edu/checker-‐framework/
• RepeaQng AnnotaQons
• Java Dependency Analysis Tool (jdeps)
@Schedule(dayOfMonth="last") @Schedule(dayOfWeek="Fri", hour="23") public void doPeriodicCleanup() { ... }
@NonNull String str;
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JVM and Performance Improvements
• Concurrency JSR 166 – Improved performance of exisQng APIs and addiQon of new APIs
• Reduced false sharing – Move frequently updated memory words to separate cache lines
• Tiered CompilaQon enabled by default • Faster JSR-‐292 implementaQon • Faster crypto performance on modern hardware • Permgen removal • ConQnued G1 GC improvements
10-‐30% improvement common on mulQ-‐core HW
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java SE Product DifferenQators
24
Features Free Java SE
Java SE Support
Java SE Advanced Desktop (*)
Java SE Advanced Java SE Suite
Access to My Oracle Support ✔ ✔ ✔ ✔ 24x7, 27 language support ✔ ✔ ✔ ✔ Fast fix turnarounds ✔ ✔ ✔ ✔ Access to updates on older, EOL’d versions ✔ ✔ ✔ ✔ Usage tracking feature ✔ ✔ ✔ DiagnosQcs, tooling and monitoring (desktop only) ✔ ✔ ✔ DiagnosQcs, tooling and monitoring (server/desktop) ✔ ✔ DeterminisQc GC ✔
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java in the enterprise
25
Java SE Advanced
Mission Control " Diagnose complex issues " Low overhead Flight Recorder " Back-‐in-‐Qme analysis " Plugins for many systems
Advanced Management Console " Track and manage clients at scale " Usage tracking and Deployment
Rule Sets
Support & Updates " Support of complex issues & changes " Updates to old versions like JDK 6
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java Mission Control and Flight Recorder
• In-‐depth profiling and analysis in producQon and development • Always on
– Virtually no performance overhead
• JDK and applicaQon data – InformaQon logged in all layers
• Analyze root cause – Detailed data collected leading up to the event (Qme machine)
From JRockit
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java Mission Control and Flight Recorder
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Advanced Management Console
• Track and manage clients at scale
• Usage tracking analysis, Client security configuraQon management
Introduced in 8u20
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle and Java
Java SE 8 Overview
Roadmap
1
2
3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JDK 7 End of Public Updates April 2015 • Java.com switched to JDK 8 on Oct 2014 • AU from JRE 7 to JRE 8 Jan 2015 • JDK 7 updates only on MOS starQng with Jul 2015 CPU
• For details/public noQce: – Search “Java EOL” – Click on: Oracle Java SE Support Roadmap
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Chrome (lack of) support • Chrome drops NPAPI, JRE Plugin requires NPAPI • Oracle plans to support Chrome as long as Chrome allows NPAPI
– Applets will not work on Chrome aFer it drops NPAPI – Webstart applicaQons will conQnue to work from Chrome
• Official statement The Java Plugin for web browsers relies on NPAPI, which is currently supported by all major browsers. Google has recently (May 2014) removed Chrome NPAPI support on Linux only. However, that has never been a supported or cerOfied configuraOon for Java in the browser, so impact should be minimal. Given Google's lack of specificity for fully removing NPAPI support in Chrome on Windows, and a history of terminaOng services with limited prior warning, and it's stated phasing out of NPAPI based plugins from it's Web Store we recommend users consider alternaOves to Chrome. Instead, we recommend Firefox, Internet Explorer and Safari as long-‐term opOons.
© 2014 Oracle CorporaQon – Proprietary and ConfidenQal
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JDK Roadmap
JDK 8 • Lambda • JSR 310: New Date and Time API • Nashorn: JavaScript Interoperability
• JavaFX Enhancements
8u40 • Performance Improvements • Density and Resource Management • MulQ-‐Language Support Improvements • Accessibility Enhancements • ConQnued Java SE Advanced Features • Improved app store packaging tool
JDK 9 • Modularity – Jigsaw • Performance • Web, security and I18N updates • Cloud opQmized JVM • Ahead of Time CompilaQon
8u20 • G1 Performance Improvement • JVM Performance Improvements • Java Mission Control 5.4 • Advanced Management Console 1.0 • MSI Enterprise JRE Installer • App store packaging tool
8u60 • Bug Fixes • ConQnued Java SE Advanced Features
2016 2014 2015 2017
33
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JDK 8u40 Release Content
• Performance – Memory footprint opQmizaQons – Reduce need for full GCs in G1 – Crypto improvements on SPARC
• Small feature enhancements (highlights) – Nashorn: Improved integraQon with Java security model, ECMAScript 6 preparaQons, performance
– JavaFX: Modernize media stack on OS X, Accessibility – Install/config: Improved packaging tool for app stores, etc (javapackager) – JavaDB and Mission Control updates
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java SE Advanced Upcoming Features
• Advanced Management Console 2.0 – Desktop JRE management – Improved usage tracking/analyQcs – AudiQng of installed versions, configuraQon – Centralized configuraQon management – Tool support for building customized JRE installers – Improved scalability (100,000s of JREs)
• Resource Management APIs – Define resource contexts, tracking of CPU/memory/IO usage per context – OOTB WebLogic Server integraQon, open API for 3rd party integraQon
• Other Future AddiQons – CooperaQve Lifecycle support for virtualized/cloud environments – Low-‐latency GC (vastly enhanced variant of JRockit DeterminisQc GC)
Desktop Management, MulQ-‐Tenancy OpQmizaQons
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JDK 9 Release Content (1/2)
• Jigsaw – Modularized JDK, Java module system
• Performance – JIT, locking, memory footprint enhancements – Crypto acceleraQon enhancements
• Web, Security, InternaQonalizaQon updates – HTTP 2.0, JAXP update – JCE updates, TLS updates, DTLS support, Keystore enhancements – Unicode 7, UTF-‐8 properQes support
• Serviceability – Improved JVM logging – More diagnosQcs commands
Under review for inclusion in 9*
* As of October 31, 2014. For up to date informaQon, see openjdk.java.net.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JDK 9 Release Content (2/2)
• Other features – Ahead of Time compilaQon (improved startup Qme) – Read Eval Print Loop (REPL) support in JDK – Enhanced volaQles – OS Process control API
• Cleanup – Remove old GC combinaQons (deprecated in JDK 8) – Remove old/less frequently used tools from JDK – Revisit version numbering scheme – Block access to JDK internal APIs by default
• Tooling – javac enhancements – JIT, locking, memory footprint enhancements
Under review for inclusion in 9*
* As of October 31, 2014. For up to date informaQon, see openjdk.java.net.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Avoid private (internal, non-‐spec) APIs Private APIs are (finally) going away
Oracle ConfidenQal – Internal
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Some APIs were never supposed to be used…
Oracle ConfidenQal – Internal
Warnings posted from Feb 1998 to today
h]p://java.sun.com/products/jdk/faq/faq-‐sun-‐packages.html (no longer valid, but available on some archive sites) h]p://www.oracle.com/technetwork/java/faq-‐sun-‐packages-‐142232.html
1998 Coolest phone Nokia 5110
39
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Exec summary of previous page • Private packages like sun.* are “JDK internal workings”
– Not part of the specificaQon – Are not supported – Any one might change/disappear in any release without advanced warning
• Smart and informed developers do not use private JDK packages • Smart and informed developers do not let friends use private JDK packages
Oracle ConfidenQal – Internal 40
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Exec summary of previous page (Updated) • Private packages like sun.* are “JDK internal workings”
– Not part of the specificaQon – Are not supported – All of them will “disappear” in JDK 9 with plenty of advanced warning
• Smart and informed developers do not use private JDK packages • Smart and informed developers do not let friends use private JDK packages
Oracle ConfidenQal – Internal 41
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
What to do if you think you are using internal APIs • For your own code
– Use JDeps, available on JDK 8, to scan your programs/libraries for problems • When possible JDeps will propose alternaQve APIs
• For Third Party Programs and Libraries – You can run JDeps on the bytecode so you don’t need the source code – Point the vendor to the many arQcles warning of the need to remove dependencies on this; ask your vendor to confirm if they are ready for JDK 9
– Search for alternaQve programs / libraries
• If unable to move off private APIs – Plan to keep JDK/JRE 8 for those programs unQl you can find a replacement
Oracle ConfidenQal – Internal 42
For JDeps introducQon and explanaQon search for:
Closing the closed APIs
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Future DirecQon
• Known “Weaknesses” – Startup & Warmup Qme – Memory overhead – OpQmizaQons for more specialized hardware (vector instrucQons, GPUs, zero-‐copy I/O, transacQonal synchronizaQon/memory)
– Unpredictable latency due to GC – Code verbosity
• “New” OpportuniQes – Big Data (eg, the Hadoop ecosystem) – Cloud & large mulQ-‐tenant deployments – (More) JVM improvements for non-‐Java languages
Addressing Big Problems and InteresQng Areas
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
The Next Big Challenge: Data layout
• Java is very good at opQmizing code, less so at opQmizing data – Memory overhead, less than opQmal performance, difficult to uQlize modern hardware
• Java’s type system gives us primiQves, objects, and arrays – Very flexible! Can model almost anything.
• But flexibility is not exactly where we need it – PrimiQves are very rigid – Objects are more flexible than we always need
• The big problem: object idenQty – Needed for polymorphism, mutability – Not all objects need it, but all objects pay for it
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Data layout What we have today
final class Point { final int x; final int y; }
header Point[] pts =
header
x
y
header
x
y
header
x
y
header
x
y
header
x
y
Layout of these in memory is effecQvely random!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
header
Data layout What we’d prefer
header
x
y
x
y
x
y
x
y
Point[] pts =
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
R&D Projects to address Data Layout Challenge
• Common theme: more flexible access to data – Value types – opQmized layout of Java objects – Panama – metadata-‐driven access to naQve code and data (JNI replacement) – Generic specializaQon – bring the benefits of value types to generics – VarHandle – more flexible, high-‐performance access to variables – Arrays 2.0 – flexible data layout
• Benefits: Improved developer producQvity, reduced memory overhead, enable efficient execuQon on modern CPUs & GPUs, improved overall performance
• “Natural conQnuaQon” aFer JDK 8 Lambda FuncQons & Streams
Not yet in release roadmap, but expect someQme aFer JDK 9
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
More InformaQon, AcQons
• Join a user group – h]ps://www.java.net/jugs/java-‐user-‐groups
• Prepare for change – h]ps://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool – Move to 64-‐bit – Sign your applets
• Follow JDK development, help with early access tesQng – h]p://openjdk.java.net/projects/jdk8u/ – h]p://openjdk.java.net/projects/jdk9/ – h]p://wiki.openjdk.java.net/
• Contribute! – h]p://openjdk.java.net/contribute/ – h]ps://java.net/projects/adoptajsr/pages/Home – h]ps://java.net/projects/adoptopenjdk
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Public Availability vs. Long Term Support
• Updates to older releases become private when all 3 condiQons are met – Three years aFer general availability of the release going private – One year aFer being superseded by a new major release – Six months aFer the new major release is made the default on java.com
• Oracle sells support for each major release up to 11 years – Eight years of premier support
• Plugin included on the JRE only the first 5 years – Three years of extended support (addiQonal cost)
Updates to current major release always publicly available
50
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle SoFware LifeQme Support Policies Key Feature Premier Extended Sustaining Major Product and Technology Releases ✔ ✔ ✔ Technical Support ✔ ✔ ✔ Access to Knowledge Base ✔ ✔ ✔ Updates and Fixes ✔ ✔ Pre-‐ExisQng Security Alerts ✔ ✔ Pre-‐ExisQng CriQcal Patch Updates ✔ ✔ Pre-‐ExisQng Tax, Legal, and Regulatory Updates ✔ ✔ Pre-‐ExisQng Upgrade Tools/Scripts ✔ ✔ Pre-‐ExisQng Access to PlaQnum Services ✔ CerQficaQon with most exisQng Oracle products ✔ ✔ CerQficaQon with most exisQng third-‐party products/versions ✔ ✔ CerQficaQon with most new third-‐party products/versions ✔ CerQficaQon with most new Oracle products ✔
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 52
Oracle Standard vs Java Support Policies
5 Years Premier 3 Years Extended
8 Years Premier 3 Years Extended5 Years Deployment Support
Most Oracle Products
Oracle JDK/JRE