New and Improved in Java 7

Since the long-awaited Java 7 will be released on 7/7, otherwise known as "tomorrow", there's no time like the present to survey its new features. At Oracle's The Java Source blog, the 25-minute video Moving Java Forward presents just such an overview. Adam Messinger (Java Development Team head), Mark Reinhold (Chief Architect of the Java Platform), John Rose (Consulting Engineer in the VM Group), and Joe Darcy (Principal Engineer in the Languages Group) engage in a Q&A that provides a useful intro to this release as well as a sense of Oracle's vision for the road ahead.

What's that you say? Don't have 25 minutes for a snazzy spoiler-filled preview? Let me save you some time.

Here's the gist of it:

Adam Messinger serves as the MC and poses the questions to each other participant in turn.

Question #1: What's the most exciting thing in Java 7?

That it's finally shipping after nearly 5 years. (Java 6 SE was released at the end of 2006!). Java 7 is an evolutionary release, but it includes a lot of good stuff.

Main idea: shiny.

Question #2: What's included in Java 7?

One of the main new features is NIO.2, the new new I/O.  JSR 51 brought the new I/O APIs to Java in 2002. This is a sequel, JSR 203, that provides a true asynchronous I/O API to support high end server apps that need low latency and high input across many connections and to support databases addressing many spindles.

Also new in Java 7 is a real file system API.  This includes simplified and amplified support for common file-related operations through universal, platform-agnostic semantics. It also includes separate abstractions for exploiting platform-specific OS features.

Main ideas: NIO.2 and File API.

Question #3: What's included for the JVM?

A new instruction: invokeDynamic. This is the first new instruction in a very long time. This was originally excluded on purpose, but what with the huge JVM language ecosystem, it's time to reconsider. This new invocation and linking mode that can be programmed to user-definable specifications will give a boost to the implementation and optimization of JVM languages other than Java.

Main idea: Java + JVM languages is the new Java.

Question #4: What's fresh in the language itself?

Project Coin includes several minor but helpful language enhancements: "Diamond syntax" for generics (i.e., type inference, so no need to restate types in constructors), simplified varargs, "try with resources" which auto-closes resources so "finally" won't have to do it, "multicatch" which allows a single catch to specify multiple subtypes of Exception, switching on a String instead of just an int or an enum, using "0b" to specify binary literals, and using underscores between digits to make long numbers look nice.

Main idea: lots of sugar, less annoyance

Question #5: What about Java 8? With the aggressive release schedule, it's on the horizon.

Java 8 will be revolutionary, like Java 5. It will include three major features.

First, Project Lambda will bring true closures to Java, empowering developers to break programs into work units without having to preschedule them or govern the sequence of their handling.  Move the code to the data, rather than the data to the locus of computation.

Interface extension methods, aka default methods, turned out to be necessary for merging the Collections API with Project Lambda. So for a given interface extension, if a class claiming to implement that interface lacks the relevant method, it'll default to a specified static method.

Second, Project Jigsaw will provide a standard module system for the Java platform, and will also be applied to the Java platform.  This will give "developers the right tools for assembling, reasoning about, constructing, and maintaining large programs".

Third is VM convergence: JRockit and HotSpot are being merged.  (In 7, the GC permanent generation is mostly gone; in 8 it'll be gone gone.)

These three big changes lay the groundwork for the eventual convergence of Java SE and Java EE.

In the language, Java 8 will offer more of Project Coin.

Main ideas: Java is evolving in a functional direction to support the multicore revolution. "21st-century machines are much bigger than 20th-century languages ever contemplated."  Language will move toward supporting big data (beyond the 32 bit cap, e.g., a long-indexed collection).

JavaThe Upshot:

Reinhold and Rose are longtime LISP aficionados, so they're excited about making Java more powerfully expressive, and they support the JVM polyglot programming paradigm. Rose plugs the upcoming JVM Language Summit. Java is (finally) evolving.

You might also like:

This entry was posted in Releases, The Gist of IT and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">