Java, you’ve come a long way, baby. Twenty years ago when a skunk-works team at Sun Microsystems launched a project that begat the Oak language (later renamed Java), nobody had any idea it would become such a significant part of IT history.
Today, Java is the programming language of choice for 9 million developers, and it powers more than 7 billion devices. In addition to driving many of the world’s business systems, Java also is being used to improve road and air safety, collect information from the world’s oceans for scientific research, help increase grain crop quality to help feed the hungry, and simulate the human brain and musculoskeletal system, Oracle officials said.
The Java language is on its eighth major version with the current Java 8 release as Oracle prepares for the release of Java 9, which is scheduled for September 2016.
Java 8, introduced early in 2014, was one of the most significant releases of the Java language in years. In fact, Oracle said it is the largest upgrade to the Java programming model since the platform was introduced in 1995. At the least, it is regarded by many software developers as the most important update since Java 5 in 2004.
Java 8 brought with it enhanced developer productivity and significant application performance increases through reduced boilerplate code, improved collections and annotations, simpler parallel programming models and more efficient use of modern, multicore processors.
The key features of Java Development Kit (JDK) 8 are Project Lambda, the Nashorn JavaScript Engine, a new Date and Time API, a set of Compact Profiles and the removal of the “permanent generation” from the HotSpot Java Virtual Machine (JVM).
JDK 8 is a production-ready implementation of the Java Platform, Standard Edition 8 (Java SE 8) platform specification. Project Lambda supports programming in a multicore environment by adding closures and related features to the Java language.
“The new date/time package was among my favorite Java 8 features,” said Wayne Citrin, CTO of JNBridge, a maker of Java and .NET interoperability solutions. “Replacing the old, broken one was long overdue. My personal favorite new Java 8 feature is the enhanced method parameter reflection, particularly the ability to extract parameter names. Customers have been asking us to map parameter names when generating proxies, and with the new reflection API, we can now do this.”
However, “one of the most popular features in Java 8 is Lambdas—adding closures to the Java language,” said Georges Saab, vice president of development in the Java Platform Group at Oracle, which acquired Sun and, thus, Java in 2010.
“That’s been nicely coupled with advances we made in the underlying Java Virtual Machine as well as in the class libraries, Saab said. Lambdas use a new bytecode, called invokedynamic, which was added to the previous Java release, Java 7, to provide high performance.
There were other additions to the Java Class Libraries, specifically a Streams API was added to the Collections API, Saab noted. The Streams API allows developers to set up a pipeline of operations to support the MapReduce style of programming, which is quite popular in the big data world, Saab explained.
Developers Embrace Java 8 Features While Looking Forward to Java 9
Mark Reinhold, chief architect of Oracle’s Java Platform Group, noted that the Streams API also makes it “easier to leverage multicore processors for bulk data operations, so you can express something as a stream and convert it into a parallel computation very easily.”
Shortly after the release of Java SE 8 last year, Oracle announced the release of Java Platform, Micro Edition 8 (Java ME 8) and the related releases of Oracle’s Java Embedded products. This provided a consistent Java 8 platform across embedded devices, desktops, data centers and the cloud. Oracle Java SE Embedded 8 provides a development platform for embedded devices and the Internet of things (IoT).
Nandini Ramani, Oracle’s vice president of development for the Java Platform, said the convergence of Java SE 8 and Java ME 8 enables users to “right-size” Java to support a variety of use cases.
Java 8 Adoption
Adoption of Java 8 has been rapid, Oracle said. At its JavaOne conference in September 2014, Oracle said Java 8 adoption was up more than 20 percent from the same post-launch time period for Java SE 7.
“From all that we can tell, Java 8 is probably one of most rapidly adopted, if not the most rapidly adopted, major releases of Java,” Saab told eWEEK. “There’s a combination of things there. One thing is it hasn’t been that long since Java 7 came out so people were used to updating to a major release. The team put a lot of focus on compatibility and making sure the update from Java 6 to Java 7 was easy.”
Two-thirds of the respondents to a Typesafe survey from September 2014 said they were running Java 8 or had committed to switching within a year.
“It’s truly remarkable how quickly the Java developer community has rallied around Java 8,” said Jonas Boner, CTO and co-founder of Typesafe. “Innovation around Java and the JVM is transforming the modern data center infrastructure.”
Fully 80 percent of survey respondents cited Lambda expressions and virtual extension models as the most important new Java 8 feature. Another 47 percent called out enhanced core libraries with Lambda as the second most important new feature. Other popular Java 8 features included the date and time API (37 percent), bulk data operations for collections (37 percent) and concurrency updates (27 percent).
“Java 8 has already become the de facto development platform for Tasktop and many of our partners,” Mik Kersten, CEO and co-founder of Tasktop Technologies, told eWEEK. “Its adoption was faster than we expected due to the large number of small but important API additions and improvements,” he said.
“On the innovation side, it looks like Oracle succeeded at leveling the playing field with a graceful introduction of Lambdas and functional interfaces. This gives functionally-minded developers what they’re after, reducing some of the previous desire to move off Java to other languages,” Kersten said.
Lambdas truly bring functional programming to the day-to-day Java developer for the first time, said Martin Verburg, founder and CEO of jClarity and co-leader of the 4,000-strong London Java Community user group. He added that a lot of Java developers who wanted to do functional programming had moved to other languages, such as Scala, Groovy and Clojure, but with Java 8, many are coming back to the Java fold.
Developers Embrace Java 8 Features While Looking Forward to Java 9
In a blog post on Java 8, Ted Neward, a well-known .NET and Java consultant, author and speaker, said he believes Java remained fairly static until Java 5.
“With Java 5, we got generics, enumerations, annotations, [enhancements] for loops, variable argument declarations” and a few other things, as well, he noted. “Java 8 represents another Java 5-like ‘sea change’ kind of release. Not because there’s a ton of new features, like Java 5 had, but because the introduction of lambdas,” which will change the ways developers express concepts in Java, Neward said.
The addition of Lambdas in Java 8 had real-world relevance to financial services giant Goldman Sachs, where Donald Raab, managing director and head of the firm’s JVM Architecture group, said it enabled his team to reduce lines of code by 9 percent in their test modules for GS Collections. GS Collections is an open-source framework Raab developed at Goldman Sachs that replaces the Java Collections Framework.
“Java 8 has created a very real opportunity for Java developers to improve their code bases by effectively leveraging higher-level implementation patterns,” Raab said. “We hope that LOCD [Lines of Code Deleted] will become the metric that Java developers most enjoy reporting.”
Looking Ahead to Java 9
Under Oracle’s stewardship, two major platform releases, including Java 7 and Java 8, have been delivered, with Java 9 slated for September 2016.
The key enhancements to Java 9 will come from Project Jigsaw, which aims to modularize the platform to make it scalable to a wider range of devices, make it easier for developers to construct and maintain libraries and large applications and improve security, maintainability and performance, Oracle said.
Other features slated for Java 9 include the Java Shell, an interactive tool for evaluating snippets of Java code; a new HTTP client API to support HTTP/2 and Web Sockets, a port to the ARM AArch64 architecture on Linux as well as a variety of updates to existing APIs along with some significant performance improvements.
“We’re working on quite a few things, not just for Java 9 but beyond 9,” Reinhold told eWEEK. “In Java 9 we’re trying to tackle two big problems. One is the fact that the Java SE platform is this big monolithic thing that can’t be divided and is, therefore, difficult to deploy on small devices or en masse in large cloud environments, he said.
“The other big problem we’re trying to tackle is that assembling large applications is a fairly brittle thing because the Classpath is very weak technology with which to do that. So we’re going to attack both of those problems by introducing a module system that we’ve been working on for a while and that will address both of those categories of issues,” Reinhold explained.
Developers Embrace Java 8 Features While Looking Forward to Java 9
Meanwhile, beyond Java 9, Oracle is looking at “some further extensions of the language, in particular to introduce Value Types, which are a way of defining a very lightweight class that never needs to be allocated in memory and therefore can be laid out very efficiently in arrays,” Reinhold said.
According to the Typesafe survey, nearly 30 percent of respondents said they were already looking forward to Java 9 with “strong interest.” Two major Java 9 features were of particular interest with 48 percent of respondents stating they were most excited about Value Types, while 43 percent said they are most interested in Project Jigsaw.
Open-source Java tools developers are also expressing support for Java 9. “Eclipse will be shipping full support for Java 9 once it is available,” said Mike Milinkovich, executive director of The Eclipse Foundation, which provides some of the most popular tools available for Java developers.
“Java 9 will require even more work than Java 8, because modularity will require enhancements to the tools for application building and packaging as well as compiler and editor enhancements,” Milinkovich said. “We will be shipping interim feature packs over the next year and a half so the community can try out Eclipse with Java 9 during development.”
In fact, it looks like modularity will be an important factor for Java 9 adoption. “I think the most exciting and broadly anticipated thing coming to Java 9 is modularity,” said Al Hilwa, and analyst with IDC. “I think this will have a long-term impact in terms of the longevity of the language and its ability to be evolved to accommodate new requirements. But Java 9 has many other improvements coming, as well, like the JSON [JavaScript Object Notation] API and the process API.”
Yet, with Java being such a mature language and platform, how much more room is there for innovation? Reinhold said there is plenty.
However, “we will continue to evolve the language and the platform within the conservative pattern that we’ve established,” he said. “We will not be breaking the code, but over the years, we’ve learned how to essentially lift up the house and pour a new foundation underneath it, Reinhold said.
“Overall, the complexity budget of the language has a bit more room to grow, not a whole lot, but I think there’s a bit more to go,” he said.