Oracle Commit to Java Modularity

Oracle have announced the second set of enhancement proposals (known as JEPs) that will deliver features for Java 9, including major news about Java modularity.

The first round of features was announced on August 11th, and was a relatively modest, although useful, set of features. By contrast, this announcement contains some of the real meat for Java developers. Following the commitment made by Oracle that the delayed modularity project will ship as part of JDK 9, Oracle have produced a series of four JEPs to deliver a redesigned solution for Java modularity.

Oracle's Java engineering team have already delivered JEP 162 (Prepare for Modularization) and JEP 201 (Modular Source Code). The second of these JEPs completely changed the layout of the JDK source, and rearranged it to align with the new module boundaries. The description of the module system itself is contained in JEP 200, although this has not actually been delivered yet, presumably because the details may change depending upon issues encountered when building the implementation.

The new batch of JEPs includes JEP 220 (Modular Runtime Images), and this is effectively the point of no return for modularity. After this point, The Java runtime system will no longer be contained in jar files, and instead will be composed of modules. Files such as rt.jar and tools.jar will be a thing of the past. The new system will consist solely of modules, although the platform will continue to accept and run applications and libraries packaged as jar files. The intention is that over time, application developers wil migrate to the new modular formats as well.

Mark Reinhold, Chief Architect for the Java platform, commented that for the Java runtime system contained in the JRE and JDK: "The JAR format has run its course. It's time to move on". He also recognized that the move to a modular system will have major implications for IDEs, tool makers and many frameworks, as the current introspection mechanisms rely upon a URI syntax that is tied to the legacy JAR format.The outreach programme is being run by Oracle's Quality group, with community support from the London Java Community and a global group of JUGs under the AdoptOpenJDK and AdoptAJSR projects. A number of key open source projects have already been contacted, including Apache projects: Ant, Builds, log4j, Hadoop and CXF as well as Eclipse, Hudson, IntelliJ, RedHat Netty, Redhat Tools, TestNG.

Oracle are also preparing a draft of a Java Specification Request to cover the module system specification as a new Java standard.

Seeing as there are many circular dependencies among the class libraries and that for the most part all public classes and methods are effectively exposed to the world, how will Oracle avoid having to create one or more large "mudball" modules for the JDK?

The latest round of early access JDK 9 builds from Oracle now have modular runtime images, although the compatability layer isn't in yet. There are lots of opportunities to help here - if you'd like to participate, please contact myself or Martijn Verburg.

The current ship date for Java 9 has not been announced - I would expect it to be Autumn 2016 for 2 reasons 1) Oracle try to keep roughly a 2-year cadence between releases & 2) Java 8 went GA almost exactly 2 years after the M1 build was released. We don't have a roadmap or an M1 for Java 9 yet, but it can't be far off.

Analysis of the dependencies has already been done, and whilst there is obviously a core that is necessary (essentially the transitive closure of types referenced by Object), the size of the java.base module may not be as large as you might expect.

As additional evidence, recall that Java 8 has Compact Profiles, which are substantially smaller than the full JRE.

InfoQ Weekly Newsletter

Join a community of over 250 K senior developers by signing up for our newsletter. If you are based in the EEA, please contact us so we can provide you with the protections afforded to you under EEA protection laws.

Is your profile up-to-date? Please take a moment to review and update.

Email Address

Note: If updating/changing your email, a validation request will be sent

Company name:

Keep current company name

Update Company name to:

Company role:

Keep current company role

Update company role to:

Company size:

Keep current company Size

Update company size to:

Country/Zone:

Keep current country/zone

Update country/zone to:

State/Province/Region:

Keep current state/province/region

Update state/province/region to:

Subscribe to our newsletter?

Subscribe to our architect newsletter?

Subscribe to our industry email notices?

By subscribing to this email, we may send you content based on your previous topic interests. See our privacy notice for details.

You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.