Java SE 8 and a final version of OpenJDK 8, with support for lambda expressions, are expected to be released on March 18, according to Oracle, which oversees the language and platform. The lambda support is the biggest functionality addition to Java since the inclusion of Generics in Java SE 5.

Georges Saab, vice president of software development at the Java Platform Group inside of Oracle, as well as the chairperson for the OpenJDK committee, said that Java 8 is all about expanding the power of developers.

“We’ve been trying to evolve Java in a way that brings more power and choice to Java developers while still feeling very natural,” he said. “It makes it simpler to program, increases the power, and in conjunction with the Strings API, gives you a way to do a pipeline of things, so it’s really clear. The boilerplate code is reduced. The intent of what you’re trying to do is cleaner. It means it’s more maintainable going forward.”

(Related: Project Nashorn: The bridge between Java and JavaScript)

That new Strings API is just one of many additional APIs inside of the Java language’s core set of libraries and capabilities.

Since April 2012, Java SE 8 and OpenJDK 8 have been focused almost entirely on the new lambda expressions. While there are numerous other features and bug fixes in this release, the desire to support lambda expressions was the reason the project’s releases were delayed beyond last summer when it had become feature complete.

But with this forthcoming release, lambdas will see first-class support across Java. Gil Tene, CTO and cofounder of Azul Systems, said that OpenJDK 8 will not only offer lambdas to users, it will use them internally to optimize the Java platform.

Most important, he said, is “The fact that lambda expressions are a first-order thing in the JVM. Unlike in Java 7, in Java 8 we’ll see Java itself make use of [lambdas] in the very significant core libraries, and in the Parallel Collections and Stream APIs will make use of lambda expressions. Java 8 will have interesting language features,” which he said should experience faster uptake than previous new features in Java.

#!Saab said that a major focus of OpenJDK 8 and Java SE 8 was “making sure the performance is still excellent. This is the largest change ever been made to Java. This is a change we made both to the languages and in the Java virtual machine.”

Other changes to the language include the new Date and Time API, and the removal of restrictions that kept annotations from being used outside of class/method/field/variable declarations. The new String API finally includes a string joiner, which has been long absent from the language, and was frequently added by hand by developers.

What’s not in OpenJDK 8 and Java SE 8 is Project Jigsaw, an attempt to split the Java platform up into a more modularized set of components. This effort turned out to be too complex for the Java 8 release, and has thus been pushed back to Java 9.

What’s a lambda expression?
From the Java Community Process board’s initial proposal for lambda expressions:

We propose extending the Java Language to support compact lambda expressions (otherwise known as closures or anonymous methods.) Additionally, we will extend the language to support a conversion known as “SAM conversion” to allow lambda expressions to be used where a single-abstract-method interface or class is expected, enabling forward compatibility of existing libraries.

We propose extending the semantics of interfaces in the Java Language to support virtual extension methods, whereby an interface can nominate a static default method to stand in for the implementation of an interface method in the event that an implementation class does not provide an implementation of the extension method. This enables interfaces to be augmented with new methods “after the fact” without breaking existing implementation classes.

Time permitting, we will use these features to augment the core Java SE libraries to support a more lambda-friendly style of programming, such as:
      Collection collection = … ;
      collection.sortBy(#{ Foo f -> f.getLastName() });
or
      collection.remove(#{ Foo f -> f.isBlue() });

This will likely be accompanied by a set of standardized “SAM” types such as Predicate, Filter, Mapper, Reducer, etc.