BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Oracle Announced Plans to Open Source All Features of Their JDK and Address Shortcomings in Java EE

Oracle Announced Plans to Open Source All Features of Their JDK and Address Shortcomings in Java EE

Bookmarks

During the opening keynote at JavaOne this year, Oracle announced plans to release Java SE under GPL and to open-source all the features in Oracle’s JDK.  The vendor also admitted that Java EE wasn’t fit for the new world of microservices and serverless, and talked about plans to address the issue.  Case studies on modern microservices architectures were provided by Alibaba and Spotify. The full keynote video is available on YouTube, but below we’re providing a summary of the key information.  

The session started with a talk from Michael Greene, vice president of System Technologies and Optimization at Intel Corporation. He talked about how “the future’s most valuable currency is data” and stressed that Intel’s Xeon processors are ready to handle it. His talk seemed like a sales pitch at times, but it was cool to see Intel open sourcing their Persistent Collections for Java. According to the project’s README, this library provides Java classes whose instances can persist (i.e., remain reachable) beyond the life of a Java VM instance.

Greene invited Kinsum Chow, chief scientist at Alibaba Systems Software, on stage. Chow talked about how they’re running 100,000 Java applications written by 10,000 developers, running on about 1 million instances. Alibaba is the largest e-commerce site in China, and their revenues are right behind Argentina as far as economies of the world. They run a customized version of the OpenJDK, Called AJDK. Alibaba built something they call “Distributed Java Services”, which are modular services that operate independently of each other. There weren’t many technical details given but this sounded similar to other microservice approaches.

Alibaba operates at a tremendous scale. November 11, 2016, was the largest online e-commerce festival in China, similar to Black Friday in the US. Last year, total sales in the US was 12.8 Billion over Thanksgiving and Black Friday. Alibaba did 17 billion in sales on November 11 in China, handling 175K transactions per second at their peak.

Transactions during China's singles day

At the end of his talk, Greene talked about microservices and how Intel is trying to simulate loads similar to the ones that Alibaba has. They’ve started a Data Bench project on GitHub to help with this. It’s a proof of concept framework to show real-world microservice workloads.

After Intel finished, Mark Cavage, VP of Product Development, Java and Container Native Platform, took the stage. He noted that over the last two decades, Java has continued to bring value. It's the #1 language, with 12 million developers, 38 billion active virtual machines, and 21 billion cloud-connected virtual machines.

Cavage said that Oracle is on a new mission to have developers use “Java first, Java always”. They want to get people to start with Java instead of "growing up" to be a Java shop. Java SE is open, evolving, nimble, and scalable. Java EE 8 is here, with HTTP/2 support, async APIs, and reactive APIs. “But that's not good enough,” Cavage said.

We need to do a lot more to modernise; to get you to that world of cloud and microservices and serverless.  Because the reality is EE is the bedrock of mission critical systems; it does power enterprise. And if we look at why it isn’t getting us there it is pretty self evident.  Is it open? No, it’s a vendor consortium, last time I checked those aren’t that open. Is it nimble? Well is shipped four years ago, that’s not very fast. We’re going to change everything about this.

The hope is that by opening up Java EE and moving to it to the Eclipse Foundation (as InfoQ previous reported), the platform will be able to evolve more quickly.

Cavage invited David Blevins (Tomitribe), Ian Robinson (IBM), and Mark Little (Red Hat and InfoQ contributor) on stage to say a few words about the open sourcing of Java EE.

Blevins: You're inheriting EE. EE4J is EE for the next generation. Having access to the TCKs is huge!

Robinson: I think the Eclipse Foundation is a good choice. It’s the one IBM chose when they open sourced the J9 virtual machine. Access to the TCKs is great for developers. Having a new community will give developers encouragement. Open sourcing J9 and WebSphere Liberty took a year, so it could take awhile.

Little: We created microprofile over a year ago. We've seen a great groundswell of interest and participation. Moving EE to Eclipse allows these two big communities to come together and drive Enterprise Java into the next decade.

After getting a few words from these Java EE luminaries, Cavage told the audience “the charter is open, come help!”

He then switched to talk about Java SE and announced that OpenJDK will be available under a GPL license. All features in the Oracle JDK will be open sourced, eventually. “There will be zero differences between the OpenJDK and the Oracle JDK” Cavage said. Java SE will also have new releases every six months.  

James Governor, co-founder of Redmonk, came on stage to talk about Java. Last time he was at JavaOne was in 2004. He said that “things have changed in the Java ecosystem more in the last three weeks more than in the previous 13 years”.

Governor observed that many of the big web companies had adopted Java.

First generation web companies - Amazon was very much a Java Shop, Google tons of Java, although they have Go and other languages now. But what is perhaps more interesting is those companies who said "We don’t like Java, we’re going to be Ruby." Twitter was going to use Ruby until it wouldn’t scale far enough and they adopted Java. Facebook wasn’t interested in Java until they become one of the biggest Hadoop shops on the planet.

Why did web companies decide they needed to adopt Java? Partly because it was easier to hire people with Java skills. But it is also the case that while Startups like to move fast and break things, people like to sleep through the night. Companies wanted observability, performance, and traceability - Java and the JVM have a real value here.

You can read more about Governor’s thoughts about Java in his post Java ecosystem, 2017.

Next up was Niklas Gustavsson, principal architect at Spotify. Since October 2009, Spotify has grown to 140 million users, and they recently launched in Thailand. They handle more than three billion streams per day, and handle four millions requests per second to their backend.

Spotify started out with a Python backend. Python was great at the beginning, but they eventually ran into scalability problems. They had one service (search) written in Java that handled scalability problems much better. They had insights into the JVM and were able to see what was happening.

They made an early architectural decision to adopt microservices. Now, most of their services are Java-based, and they have around 1200 in production. They gradually migrated their services to Java service-by-service. Microservices work well for them because they can scale the services independently.

Spotify open-sourced their Apollo framework to make it easy to build new microservices. Using it allows them to have one click from creation to deployed, with a backend that runs in fully redundant multiple data centers around the world. Ownership of services is distributed to autonomous teams that run what they build.

At Spotify, the JVM is also used for data processing and machine learning. Data processing is based on Scio, which uses Scala and Python. They also use Styx, a scheduling framework for Docker. Google Dataflow and BigQuery are other key components of their machine learning system.

Following Gustavsson, Craig McLuckie, CEO of Heptio, and Kubernetes Co-Founder took to the stage.

Kubernetes has emerged as pretty close to a standard. It’s an open source container orchestrator. The fact that it’s open source is key. Containers have become an amazing way to simplify the operations process. Using Kubernetes gives you a medically sealed and predictable system that’s decoupled from its environment and operating system. By using a dynamic orchestrator, you can decouple monitoring and scaling from your application too.

Kubernetes is creating a distributed systems operating system. It makes your app perfectly decoupled from your cloud provider, and it works the same on-premise and in the cloud.

McLuckie noted that his company is part of the Cloud Native Computing Foundation.

The stage returned to Cavage to talk about JFR (Java Flight Recorder). JFR lets you diagnose any Java application with no performance overhead. It's great for a single JVM, but difficult for microservices or cloud services. To provide real-time diagnostics in the cloud, Cavage invited Varun Madan, director of software development at Oracle, to the stage. He brought George Mathew, lead engineer at Oracle, with him. Mathew demo’d a low-overhead cloud diagnostic service, known as Wercker, from a company that Oracle recently bought.

Chad Arimura, vice president of product development at Oracle, took the stage to talk about Servlerless. He announced the Fn project, a container native serverless platform. The Fn project consists of a Fn server, a Java FDK (Functional Development Kit), and Fn Flow. Flow is a system that enables developers to build higher-level workflows. Sequencing, chaining, fan in, fan out, etc. Java is the first officially supported language. It’s interesting to see on the Fn project’s GitHub README that it’s written in Go.

Finally Mark Reinhold, chief architect of the Java Platform Group at Oracle, took the stage to talk about Java 9. He noted that the key core values of Java are readability, simplicity, and compatibility.

A module is a set of packages designed for reuse. A module declaration is done in a module-info.java file. Using --module-path is cleaner and safer than -classpath. It can guarantee two key properties:

  1. Reliable configuration. If a module is not available at compile time, there’s an error. If it’s not found at runtime, there’s an error. The errors are easy to read and understand.
  2. Strong encapsulation. Code outside the module can only access packages that are exported. This allows you to hide internal classes and implementations.

Since the platform is now modular, it's also scalable. If you have a module that just needs java.sql, you can configure a new runtime system with jlink. Reinhold showed a “Hello World” demo that uses SQL and httpserver. He showed that instead of a 250MB docker image, you can can trim it down to a 39MB image.

Reinhold noted that you don’t have to convert all your code to modules to run on Java 9 since the classpath is still there. In fact, the two can peacefully co-exist. Reinhold said he’s heard people say "Jigsaw breaks everything". That’s not true, "Jigsaw breaks *some* things…"

...If your code only uses standard Java SE 8 APIs, then it will most likely work on JDK 9 without changes. If your code depends on JDK internals, then it may require changes.

Reinhold showed a list of open source projects that work on Java 9, identified by #WorksFineOnJDK9 on Twitter. He also mentioned how you can use jdeps to figure out if a JAR uses internal JDK APIs.

Java Releases are "grand and majestic”, but they're slow. Now there will be a new feature release every six months. If a future isn't ready, it doesn't go in. It can catch the next release in six months. March 2018 is the next feature release, then September. There will be a "Long Term Support" (LTS) release every three years.

There are a number of projects on the horizon for the JDK: Panama, Valhalla, Amber, and Loom, which is just a proposal at this point.

Brian Goetz, Java Language Architect Oracle, joined Reinhold on stage to talk about project Amber and its local-variable type inference. The best way to see how it works is to look at some Java code. In the “Java 18.3” example below, the compiler figures out the types for you.

// Java 9
URL url = new URL("http://openjdk.java.net");
URLConnection conn = url.openConnection();
Scanner scanner = new Scanner(conn.getInputStream(), "UTF-8");

// Java 18.3
var url = new URL("http://openjdk.java.net");
var conn = url.openConnection();
var scanner = new Scanner(conn.getInputStream(), "UTF-8");

This feature has already been committed to Java 10 repos. That means it will be part of the JDK as part of its next release in March.

Reinhold ended they keynote saying there's a continuous pipeline of things to do to Java.

Rate this Article

Adoption
Style

BT