JavaOne – Legacy Developer’s Guide to Java 9

“Legacy Developer’s Guide to Java 9”

Speaker: Wayne Citrin

For more blog posts from JavaOne, see the table of contents


Multi-Release Jar Files

  • Pre Java 9, can use late binding where probe API at runtime and fall back to old approach. Reflection is ugly
  • add Multi-Release: true to manifest
  • Can specify folders for different version of Java
  • Can only specify versions Java 9 or later in folders. But can target Java 1.7 or 1.8 or whatever in root folder and provide Java 9 options in the “9” folder. Good for backward compatibility
  • Unknown how increased release cadance will affect this
  • New jar tool so can pass -legacyFolder and -release options.

Modules

  • Can use ordinary jar files aongside modularized jars and include in module path
  • A modularied jar file in the classpath is treated like any other jar file – the module rules are not enforced – no wins, but does work; good for migration
  • All ars in the classpath are considered part of a single unnabled module – exports everything to other odules and can access al other modules
  • If you hae a modularized app (aka you have a module path) but some old jars, just put in classpath
  • If put non-modularized jar in modpath, it becomes an automatic module with the module name using the name of the jar file. It exposes everything and can acess everything. Still useful so other modules can refer to it as a dependency
  • A package can only be in one named module (including automatic module – if not, will get runtime error
  • Can often put legacy jars in mod path

JLink
For sending custom JDK distros

My take: Wayne said this was intended to be a talk vs a BOF. So he had slides. Worked out well since this is a topic where more people have ideas than can offer information. Good end to the day.

JavaOne – keynote

For more blog posts from JavaOne, see the table of contents


This blog post is like a sandwich. I arrived a few minutes late due to not allowing enough time for security. And leaving a little early so ready for my session. Sat at aisle in last row so easy to leave. Feels weird sitting all the way in the back. But cool because see whole audience.

Data from Intel

  • Data is to this century what oil was to the last
  • Autonomous car generates 14TB a day
  • Moving from compute centric to data centric world
  • Speed, operating at Scale and Smarts (AI and make better decisions)
  • Talked about chip improvements
  • Persistent memory – speed of SSD
  • Pilot library for persistent collections
  • Alibaba talked about how Singles Day had more traffic than Black Friday. Along with importance of hardware, persistent collections and representative workloads
  • Data Bench for testing
  • BigDL uses Hadoop for deep learning. Works with Java, Scala and Python
  • Talked about importance of scalar/vector processing for graphics. Intel posted a long URL on the screen for the Vector API Developer Program

Stats

  • #1 Programming language
  • 12 million developers
  • 38 bilion VMs
  • 21 billion cloud connected VMs

Mark Cavage

  • Themes: Open, Evolving, Nimble, Scalable
  • “When companies grow up, they use Java.” “People rewriting in Java”
  • Hard to remove things, but need to in order to stay relevant
  • Moving Java EE to Eclipse foundation should make more nimble. Moving everything spec, reference implementation, TCKs, etc
  • Brought up rep from Tomitribe (Tomcat), IBM and RedHat
  • Inherit a lot. EE4J is like enterprise Java for the next generation
  • IBM released their JDK to Eclipse Foundation as well – Open J9. Took a year to do that
  • @EclipseEE4J
  • Java SE 9 – modules mae it possible to evolve platform. ava 9 is the first step.
  • OpenJDK will be under GPL license
  • Oracle JDK will open source all features. Not specific commercial only one
  • Need to ship more often. Last release 3 years ago. [glad they said 3 rather than 2. planning for 2 doesnt make it so]

Redmonk

  • Companies choose Ruby until doesn’t scale Ex: Facebook is now a big Java/Hadoop shop
  • Developer ADD – want something new, shiny and fast
  • Redmonk developer rankings done quarterly looing at github and stackoverflow. JavaScript and Java always do best
  • It’s nice to have new things, but it is also nice to sleep at night
  • Spotify

    • Started with Python. Switched to Java/Scala for scale
    • Fail locally – if search fails, doesn’t affect streaming
    • Devs run and own their microservices

    >Kubernetes

    • Open source becoming more important as an alternative to vendor lockin
    • Containers decouple from environment and sometimes the OS
    • Starting to see middleware being split up by combining machines and functionality moving to libraries
    • Resource management, not just VMs

    FN Project
    Serverless project
    They staged the open sourcing on stage. Granted it was planned. But still a nice ceremony.

    Java chief architect
    Tech troubles and we learned he completely relies on a prompt screen. When prompting worked again, he started talking about the basics of classpath vs module path. These are really high level; he should have been able to speak to it. I left during his session to talk over and get ready for my lab

    JavaOne – Improve your Groovy Kung-Fu

    “Improve your Groovy Kung-Fu”

    Speaker: Dierk Koenig

    For more blog posts from JavaOne, see the table of contents


    Use cases

    • Spock for testing
    • System automation – Docker
    • Jenkins scripting console and pipelines

    Recommends Groovy ref card

    Groovy idioms

    “a” == “b” – check if two strings are equal

    a in col – check if element in a collection

    ${‘0’*10} – print 10 times

    use Collections, {
    time.shufle()
    }

    type .xyz vs .getXyz()

    use “it” (default) instead of creating a variable for grep

    catch(all) – vs catch(Exception e)

    gpars dataflows – specify what want to do in tasks, but not the order [I had trouble following this part]

    @Grab(“groupid:artifactid:version”) – get dependency from Maven Central. Can specify a resolver as first parameter if want to use an alternate one. Not worth it though because then as much work as setting up a project.

    Command line

    • groovy -e “print 1” – command line eval
    • groovyconsole – interactive UI

    My take: I like that he showed code that he wrote and pointed out idioms. Seeing well written code is helpful for seeing good practices. I also realized that I know more than I thought. Many of the items in this post I knew existed but aspire to use more. Or things I do and would like more of the team to do.