• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Java jdk-update-nov10-sde-v3m

on

  • 1,077 views

Jd

Jd

Statistics

Views

Total Views
1,077
Views on SlideShare
1,069
Embed Views
8

Actions

Likes
0
Downloads
14
Comments
0

1 Embed 8

https://stbeehive.oracle.com 8

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Java jdk-update-nov10-sde-v3m Java jdk-update-nov10-sde-v3m Presentation Transcript

    • <Insert Picture Here>Java SE UpdateSteve Elliott – Oracle UKsteve.elliott@oracle.comNovember 2010
    • The following is intended to outline our generalproduct direction. It is intended for informationpurposes only, and may not be incorporated into anycontract. It is not a commitment to deliver anymaterial, code, or functionality, and should not berelied upon in making purchasing decisions.The development, release, and timing of any featuresor functionality described for Oracle’s productsremains at the sole discretion of Oracle. 2
    • 3
    • 4
    • ?5
    • ProductivityPerformanceUniversality Modularity IntegrationServicability 6
    • Productivity Project CoinPerformance Project LambdaUniversality The DaVinci Machine Modularity Project Jigsaw IntegrationServicability JVM Convergence Roadmap 7
    • Project CoinSmall (Language) Changesopenjdk.java.net/projects/coin coin, n. A piece of small change coin, v. To create a new language ● Diamond ● Try-with-resources ● Improved integral Literals ● Strings in switch ● Varargs warnings ● Multi-catch & precise rethrow ● Joe Darcy - http://blogs.sun.com/darcy 8
    • Evolving the LanguageFrom “Evolving the Java Language” - JavaOne 2005• Java language principles – Reading is more important than writing – Code should be a joy to read – The language should not hide what is happening – Code should do what it seems to do – Simplicity matters – Every “good” feature adds more “bad” weight – Sometimes it is best to leave things out• One language: with the same meaning everywhere – No dialects Also see “Growing a Language” - Guy Steele 1999 9
    • Evolving the LanguageFrom “Evolving the Java Language” - JavaOne 2005• We will evolve the Java Language - but cautiously, with a long term view – We want Java to be around in 2030 – We cant take a slash and burn approach – “first do no harm”• We will add a few select features periodically – Aimed at developer productivity – While preserving clarity and simplicity 10
    • Project Coin Constraints• Small language changes – Small in specification, implementation, testing – No new keywords! – Wary of type system changes• Coordinate with larger language changes – Project Lambda – Modularity• One language, one javac 11
    • Better Integer Literal• Binary literalsint mask = 0b101010101010;• With underscores for clarityint mask = 0b1010_1010_1010;long big = 9_223_783_036_967_937L; 12
    • String in Switchint monthNameToDays(String s, int year) { switch(s) { case "April": case "June": case "September": case "November": return 30; case "January": case "March": case "May": case "July": case "August": case "December": return 31; case "February": ... default: ... 13
    • • Pre generics List strList = new ArrayList(); 14
    • • Pre generics List strList = new ArrayList();• With generics List<String> strList = new ArrayList<String>(); List<Map<String, List<String>> strList = new ArrayList<Map<String, List<String>>(); 15
    • Diamond• Pre generics List strList = new ArrayList();• With generics List<String> strList = new ArrayList<String>(); List<Map<String, List<String>> strList = new ArrayList<Map<String, List<String>>();• With diamond (<>) to infer the type List<String> strList = new ArrayList<>(); List<Map<String, List<String>> strList = new ArrayList<>(); 16
    • Copying Streams 17
    • 18
    • 19
    • Try-with-resources(Automatic Resource Management) 20
    • Project LambdaClosures and moreopenjdk.java.net/projects/lambda● Lambda expressions● SAM conversion with target typing● Method references● Library enhancements for internal iteration● Default methods for interface evolution● Brian Goetz - @BrianGoetz● Alex Buckley - http://blogs.sun.com/abuckley 21
    • Motivation for Lambda Project• Moores law, multi core chip• Library is one of Javas key strength – Better libraries are key to making parallelization better• Higher level operations tend to improve readability of code as well as performance• Without more language support for parallel idioms, people will instinctively reach for serial idioms 22
    • UltraSPARC T1( Niagara 1 (2005) )8 x 4 = 32UltraSPARC T2( Niagara 2 (2007) )8 x 8 = 64UltraSPARC T3( Rainbow Falls )16 x 8 = 128 23
    • For loop – External Iteration double highestScore = 0.0; for (Student s : students) { if ((s.gradYear == 2010) && (s.score > highestScore)) highestScore = s.score; }• Code is inherently serial – Iterate through students serially – Stateful – use of > and highestScore – External iteration – client of students determines iteration mechanism 24
    • Hypothetical Internal Iteration double highestScore = students .filter(new Predicate<Student>() { public boolean isTrue(Student s) { return s.gradYear == 2010; }}) .map(new Extractor<Student,Double>() { public Double extract(Student s) { return s.score; }}) .max();• Not inherently serial – students traversal not determined by developer – Looks like a functional language• Anonymous inner class! 25
    • Introducing Lambda Expressionsdouble highestScore = students .filter(#{ Student s -> s.gradYear == 2010 }) .map(#{ Student s -> s.score }) .max(); • Lambda expressions introduced with # – Signal to the JVM to defer execution of the code – Body may be an expression • Lambda expression are not syntactic sugar for anonymous inner class – Implemented with MethodHandle from JSR-292 26
    • The DaVinci Machine ProjectJSR 292A multi-language renaissance for the JVMopenjdk.java.net/projects/mlvm● Dynamic Invocation - InvokeDynamic bytecode● Method Handles● Tail Calls● Tuples● Continuations● Interface Injection ...● John Rose - http://blogs.sun.com/jrose 27
    • 28
    • 29
    • 30
    • 31
    • Hotspot Optimisations 32
    • Project JigsawModularity in the Java platformopenjdk.java.net/projects/jigsaw● Module System for JDK● Mark Reinhold http://blogs.sun.com/mr● Alex Buckley http://blogs.sun.com/abuckley 33
    • Problems• Application construction, packaging and publication – “JAR Hell”• Performance – Download time – Startup time• Platform scalability – Down to small devices 34
    • Solution – The Modular Java Platform• Enables escape from “JAR Hell” – Eliminates class path – Package modules for automatic download & install – Generate native packages – deb, rpm, ips, etc• Enables significant performance improvements – Incremental download → fast classloading – Optimise module content during installation• Platform scalability – down to small devices – Well-specified SE subsets can fit into small devices 35
    • Modularity• Grouping• Dependencies• Versioning• Encapsulation• Optional modules• Virtual modules 36
    • module-info.javaEntry point Module name Versionmodule com.foo @ 1.0.0 { class com.foo.app.Main requires org.bar.lib @ 2.1-alpha; requires edu.baz.util @ 5.2_11; provides com.foo.app.lib @ 1.0.0;} Dependency Virtual module 37
    • module-info.javamodule com.foo @ 1.0.0 { class com.foo.app.Main requires org.bar.lib @ 2.1-alpha; requires edu.baz.util @ 5.2_11; provides com.foo.app.lib @ 1.0.0; requires optional com.foo.extra;} Optional modules 38
    • module-info.javamodule com.foo.secret @ 1 { permits com.foo.lib;} Encapsulating modules 39
    • Packaging Modules• Compiling javac -modulepath mods src/com/foo/...• Packaging – supports native package format jpkg -modulepath mods jmod com.foo.app ... jpkg -modulepath mods debs com.foo.app ...• Create and install libraries jmod -L mlib create jmod -L mlib install *.jmod• Link a repository to library jmod add-repo http://jig.sfbay• Execute java -L mlib -m com.foo.app 40
    • 41
    • OSGi ?Java SE 8 JSR : 42
    • JVM 43
    • JVM Convergence● Two mainstream JVMs● HotSpot ● Versatile (client and server), market share leader, high quality and performance● JRockit ● Specialized for the Oracle server stack, basis of value-adds like Mission Control, Virtual Edition and Soft Real-Time● Wasteful to continue development on both, so● Goal: Single JVM incorporating best features 44
    • JVM Convergence● More engineers working on HotSpot so..● Converged JVM based on HotSpot with all goodness from JRockit● Open-sourced via OpenJDK ● Some value-add such as Mission Control will remain proprietary● Free binary download includes closed source goodies ● Same use license as before● Oracle committed to continued investment ● JVM teams have been merged, working on feature transfer ● And moving forward on new projects● Will be a multi-year process 45
    • 46
    • JRockit Mission Control 47
    • Roadmap 48
    • http://blogs.sun.com/mr 49
    • 50
    • 51
    • GPLv2+ Classpath Exception 52
    • 53
    • jcp.org : JSR 336 – Java SE 7 54
    • jcp.org : JSR 337 – Java SE 8 55
    • JDK 7 Schedule 56
    • 57
    • openjdk.java.net/projects/jdk 7download.java.net/jdk7 58
    • (Some) More...Mark Reinhold http://blogs.sun.com/mr ( @mreinhold )Henrik Stahl http://blogs.oracle.com/henrikDalobor Topic http://robilad.livejournal.com ( @robilad )Open JDK http://openjdk.java.net ( /projects/jdk7 ) ( @openjdk )OTN http://www.oracle.com/technetwork/java ( @oracletechnet )JavaOne 2010 http://www.oracle.com/us/javaonedevelop 59
    • Thank You! Q&A 60