• Save
The revolution of oracle java 8 webcast
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

The revolution of oracle java 8 webcast

  • 718 views
Uploaded on

The revolution of oracle java 8 webcast

The revolution of oracle java 8 webcast

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
718
On Slideshare
597
From Embeds
121
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 121

https://twitter.com 121

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | The Revolution of Java 8 Victor Ameh Oracle Fusion Middleware Technology Specialist A&C Technology Adoption Office | Partner Business Development, ECEMEA August 21, 2014 Victor.ameh@oracle.com Oracle Confidential – Internal/Restricted/Highly Restricted
  • 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Oracle Confidential – Internal/Restricted/Highly Restricted 4
  • 3. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Program Agenda 1 2 3 4 5 What in Java 8 SE is Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Oracle Confidential – Internal/Restricted/Highly Restricted 5 6 7
  • 4. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Program Agenda 1 2 3 4 5 What in Java 8 SE is New & Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Oracle Confidential – Internal/Restricted/Highly Restricted 6 6 7
  • 5. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Why Java SE 8 is Revolutionary •Java 8 SE features the most Significant Upgrade to Java programming model since Java SE 5. •Facilitates improved developer productivity through reduced boilerplate code. • Enhances project modularization with use of Compact Profiles in Java SE 8. • Modernize your applications with new changes in the Java language and core java libraries. Oracle Confidential – Internal/Restricted/Highly Restricted 7
  • 6. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Java SE 7 Java 7 APIs Language Java SE 7 CDC 1.1 CDC 1.1 (based on SE 1.4.2) CLDC 1.1 (based on SE 1.3) CLDC 1.1
  • 7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Java SE 8 Java SE 8 Java ME 8 Java 8 Java ME 8 APIs Language
  • 8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Why Java SE 8 is Revolutionary •It enables Internet of Things • Enhanced Graphics in JavaFX release of the JDK 8 •Major enhancement to the JVM to improve performance in Java 8 - Retired rarely used Garbage Collection Combinations - Removed Perm Gen to improve Heap Space Tuning. •Embedded Technology and development on embedded systems is greatly enhanced Oracle Confidential – Internal/Restricted/Highly Restricted 10
  • 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Program Agenda 1 2 3 4 5 What in Java 8 SE is New & Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Oracle Confidential – Internal/Restricted/Highly Restricted 11 6 7
  • 10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features New Date and Time APIs • A New date, time and calendar API for the Java SE 8 platform • Developed and integrated via JSR-310 with the aim of replacing java.util.Date, • Calendar, TimeZone and Date Format •Supports standard time concepts • - Partial, duration, period ,intervals • - date, time , instant, and time-zone •Provides a limited set of calendar systems and be extensible to others •Immutable value types for a multi-core world Oracle Confidential – Internal/Restricted/Highly Restricted 12
  • 11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Core Ideas for the New Date and Time API •Immutable – value classes •Domain driven design •Separation of chronologies Oracle Confidential – Internal/Restricted/Highly Restricted 13
  • 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Range of types in Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 14 • Date consists of year, month and day • Time-of-day consists of hour, minute , second - LocalDate- a date with no time and no time-zone - LocalTime – a time with no date and no time-zone - LocalDateTime – combines LocalDate and LocalTime •Time-zones handled separately ZonedDateTime- closest class to java.util Calendar •Instantaneous points in time - Instant – closest class to java util.Date
  • 13. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Range of types in Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 15 Local Date •Stores year-month-day (e.g. 21st August 2014) •USE cases: birthdays , start/end dates, holiday dates LocalDate current = LocalDate.now(); LocalDate date =LocalDate.of (2014, Month.AUGUST, 21)
  • 14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Range of types in Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 16 Local Date •Stores year-month-day (e.g. 21st August 2014) •USE cases: birthdays , start/end dates, holiday dates LocalDate current = LocalDate.now(); LocalDate date =LocalDate.of (2014, Month.AUGUST, 21) If (current.isAfter(date))… String str= date.to String() ; // 2014-08-21 Changes in Java SE 8 Core Libraries Features
  • 15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Range of types in Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 17 Local Date manipulation •Simple methods to add/subtract/set •Immutable, so methods named plus/minus/with date = date.plusMonths(3).minusDays(1);
  • 16. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Range of types in Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 18 Local Date manipulation •Simple methods to add/subtract/set •Immutable, so methods named plus/minus/with date = date.plusMonths(3).minusDays(1); date = date.withDayOfMonth(1);
  • 17. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Range of types in Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 19 Local Date manipulation •Simple methods to add/subtract/set •Immutable, so methods named plus/minus/with date = date.plusMonths(3).minusDays(1); date = date.withDayOfMonth(1); Date=date.withMonth(8); Date=date.with(Month.AUGUST);
  • 18. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 20 Local Date Adjusters •More complex alterations use adjusters - Change date to the last day of the month - change date to 2nd Friday of next month date =date.with(TemporalAdjusters.lastDayofMonth() );
  • 19. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Date and Time APIs Oracle Confidential – Internal/Restricted/Highly Restricted 21 Local Date Adjusters •More complex alterations use adjusters - Change date to the last day of the month - change date to 2nd Friday of next month date =date.with(TemporalAdjusters.lastDayofMonth() ); date = date.with(lastDayOfMonth() ) ; Date =date.with(next(TUESDAY) );
  • 20. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Base 64 Encoding and Decoding Oracle Confidential – Internal/Restricted/Highly Restricted 22 •Currently Java Developers are forced to use non-public APIs - sun.misc.BASE64Encoder - sun.misc.BASE64Decoder •Java SE 8 now has a standard way - java.util.Base64.Encoder - java.util. Base64.Decoder - encode, encodeToString , decode, wrap methods
  • 21. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes in Java SE 8 Core Libraries Features Parallel Array Sorting •Java 8 added parallel sorting capabilities to java.util.Arrays to take • advantage of multicore/multithread machines (JEP 103) •The heart of the parallel sorting algorithm lies in java.util.ArraysParallelSortHelpers. The sorting algorithm is based on CilkSort (pronounced “silk sort”). •Parallel Sorting arrays on a multicore machine can achieve performance improvements at 2 MILLION elements or greater. • The more data you’re sorting the more of a speed you receive Oracle Confidential – Internal/Restricted/Highly Restricted 23
  • 22. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 24 Lambda (JSR 335) Date/Time API (JSR 310) Type Annotations (JSR 308) Compact Profiles Lambda-Form Representation for Method Handles Remove the Permanent Generation Improve Contended Locking Generalized Target-Type Inference DocTree API Parallel Array Sorting Bulk Data Operations Unicode 6.2 Base64 Prepare for Modularization Parameter Names TLS Server Name Indication Configurable Secure-Random Number Generation Java SE 8 Nashorn Enhanced Verification Errors Fence Intrinsics Repeating Annotations HTTP URL Permissions Limited doPrivileged
  • 23. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Program Agenda 1 2 3 4 5 What in Java 8 SE is New & Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Oracle Confidential – Internal/Restricted/Highly Restricted 25 6 7
  • 24. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Lambda Expressions and Java Language Features What is Lambda Expression? •Lambda expressions are anonymous methods, aimed at mainly addressing the overhead of syntax code by replacing the machinery of anonymous inner classes with a lighter-weight mechanism in applicable cases. •Lambda expression replaces anonymous classes and removes all boiler plate code, enabling you to write code in functional style, which is some time more readable. Oracle Confidential – Internal/Restricted/Highly Restricted 26
  • 25. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Implementing Runnable Interface With Lambda Expression Example //Before Lambda expression new Thread(new Runnable( ) { @Override public void run() { System.out.println(“ too much boiler code for too little to do"); } }).start( ); Oracle Confidential – Internal/Restricted/Highly Restricted 27
  • 26. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Implementing Runnable Interface With Lambda Expression Example //Before Lambda expression new Thread(new Runnable( ) { @Override public void run() { System.out.println(“ too much boiler code for too little to do"); } }).start( ); // With Lambda Expression in Java 8 new Thread( () -> System.out.println("In Java8, Lambda expression rocks !!") ).start(); Oracle Confidential – Internal/Restricted/Highly Restricted 28
  • 27. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Stream API with Collections in Java 8 •Java 8 comes with a new Streams API java.util.stream package that allows the processing of elements of a Java Collection in parallel. •Classes in the new java.util.stream package provide a Stream API to support functional-style operations on streams of elements. • The Stream API is integrated into the Collections API, which enables bulk operations on collections, such as sequential or parallel map-reduce transformations •java.util.stream class provides function such mapToInt(), mapToLong(), and map function to apply an operation on all elements of Collections. Oracle Confidential – Internal/Restricted/Highly Restricted 29
  • 28. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Stream API with Collections in Java 8 •Stream APIs can be used in an array, a generator function or an I/O channel as a source. •Stream API enables the processing of Collections both sequentially and in parallel. This is very useful for bulk data operation. List<Order> orders = getListOfOrders(); // sequential version Stream<Order> stream = orders.stream(); //parallel version Stream<Order> parallelStream = orders.parallelStream(); Oracle Confidential – Internal/Restricted/Highly Restricted 30
  • 29. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Default Methods •Default methods enable new functionality to be added to the interfaces of libraries and ensure binary compatibility with code written for older versions of those interfaces. •Historically, could not add new methods to interfaces • - Would break existing implementations • This becomes a problem when your core APIs are over 15 years old • - Need a way to evolve existing interfaces Oracle Confidential – Internal/Restricted/Highly Restricted 31
  • 30. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Default Method Example Collection <Person> people =…; int highestAge = people.stream() …. Oracle Confidential – Internal/Restricted/Highly Restricted 32
  • 31. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Default Method Examples Collection <Person> people =…; int highestAge = people.stream() …. Interface Collection<T> { … default Stream<T> stream() { … } } Oracle Confidential – Internal/Restricted/Highly Restricted 33
  • 32. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 5 What in Java 8 SE is New & Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Oracle Confidential – Internal/Restricted/Highly Restricted 34 6 7
  • 33. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Modifications in Java Virtual Machines •Permanent Generation has been removed from Java 8 version of the Hotspot JVM permanently –No more need to the size of it –Current objects moved to Java heap or native memory – Class metadata, Class static variables •This is related to the convergence of the HotSpot and Jrockit JVMS • Retire Rarely – Used GC Combinations Oracle Confidential – Internal/Restricted/Highly Restricted 35
  • 34. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Nashorn JavaScript Engine A Next-Generation JavaScript Engine for the JVM •Can be used as an embedded scripting tool inside Java applications •Nashorn can be used from Java using the javax.script API •Nashorn can also be used from an new command line tool jjs •Provides support for shell scripting •Full JavaFx support Oracle Confidential – Internal/Restricted/Highly Restricted 36
  • 35. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Program Agenda 1 2 3 4 5 What in Java 8 SE is New & Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Oracle Confidential – Internal/Restricted/Highly Restricted 37 6 7
  • 36. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Java Flight Recorder and Java Mission Control 5.3 A tool for production profiling and diagnostics. •Basic monitoring (JMX Console) •Production time profiling and diagnostic (JFR) The latest version JMC 5.3.0 contains new features and support for JDK 8. •Minor release •Mostly bug fixes and incremental improvements •Now supports Eclipse 4.3.x Oracle Confidential – Internal/Restricted/Highly Restricted 38
  • 37. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Java Flight Recorder and Java Mission Control 5.3 Focus on low overhead • - Built into the JVM • - Already available runtime information • - High performance implementation Oracle Confidential – Internal/Restricted/Highly Restricted 39
  • 38. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Program Agenda with Highlight 1 2 3 4 5 What in Java 8 SE is New & Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Oracle Confidential – Internal/Restricted/Highly Restricted 40 6 7
  • 39. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Java 8 Security •Stronger Algorithms for Password-Based Encryption •Improve security of data in transit by moving TLS 1.2 as default •Enhanced Support for Cert Revocation Checking such as best-effort checking, CRL caching. •KeyStore Enhancements -A new command option -importpassword is added to the keytool utility, to accept a password and store it securely as a secret key •SHA-224 Message Digests -The cryptographic algorithms in JDK 8 have been enhanced with the SHA-224 variant of the SHA-2 family of message- digest implementations. Oracle Confidential – Internal/Restricted/Highly Restricted 41
  • 40. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Program Agenda 1 2 3 4 5 What in Java 8 SE is New & Revolutionary Changes in Java Core Libraries Lambda Expressions and Java Language Features Modifications in Java Virtual Machines Java Flight Recorder and Java Mission Control 5.3 Java 8 Security Summary - Q&A Q Oracle Confidential – Internal/Restricted/Highly Restricted 42 6 7
  • 41. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Summary Key Features Benefit Message Lambda Expressions Easier to distribute processing of collections over multiple threads Better application performance with simpler code for enhanced productivity Streams More functional programming style Functional style programming comes to Java - simplification and flexibility Annotations on types Better compile time error checking Speeds up app dev process Date and Time API Simplified API Simplified API, improves developer productivity Compact Profiles Reduced JRE size Expands the possibilities of Java for limited footprint environments Nashorn JavaScript engine Better JavaScript performance A new script engine with better performance for Javascript users JavaFX Better Swing interoperability; Added HTML 5 features WebView’s HTML 5 support, 3-D, embed Swing nodes inside a Scene Graph, new UI controls www.oracle.com/java8
  • 42. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Summary Migration to Java 8 SE considerations •Use Java 8 for new projects •With Default Stream APIs , leverage on existing implementations and adopt Java 8 SE in further software releases Oracle Confidential – Internal/Restricted/Highly Restricted 44
  • 43. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Q&A 45 Victor Ameh Oracle ISV Migration Center Consultant victor.amehl@oracle.com ISV Migration Center blog: http://blogs.oracle.com/imc ISV Migration Center email: partner.imc@beehiveonline.oracle.com
  • 44. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | •CONNECT WITH US •COMMUNICATE WITH US •partner.imc@beehiveonline.oracle.com •oracle.com/subscribe ASSISTING YOU ADOPT & IMPLEMENT THE LATEST ORACLE TECHNOLOGY blogs.oracle.com/IMC twitter.com/oracleIMC youtube.com/OracleIMCTeam facebook.com/oracleIMC ORACLE.COM/PARTNERS/GOTO/HUB-ECEMEA
  • 45. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 47