Looking forward to Eclipse Neon and JDK 9

Mon, 2016-02-01 08:22

Eclipse Neon will require a Java 8 runtime, which will help foster more adoption of the latest Java runtime. At this year’s EclipseCon, I look forward to presenting two sessions that go beyond Java 8 to discuss JDK 9 and the future of the Java platform. The talk on “Preparing your code for JDK 9” will cover the use of JDeps, a tool in JDK 8 which scans your code and dependencies to identify reliance on internal APIs that are always subject to change. By finding these issues in advance, developers can better spread maintenance out over time to migrate away from these internal APIs.

In many cases, the JDeps team has already prepared a list of known replacements for each API. Some of the replacements are only available in JDK 9, which poses a chicken-egg scenario for library developers. How can they use an API from JDK 9 and retain compatibility with JDK 8 and below? In this case, another JDK 9 feature comes to the rescue: multi-version JAR files (JEP-238). These JAR files offer a way to load different class files based on the runtime, for example using the older internal API with JDK 8 and below but using the public API for JDK 9 and above. JDeps is available both as a standalone tool within the JDK, as well as a JDeps Maven plugin through the standard Eclipse maven tools.

I look forward to attending EclipseCon and discussing ways to improve Java applications and adopt the next major version of the platform.