Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Java 9 Readiness

This wiki page explains how projects can check whether they are ready for Java 9 and documents the state for each release train project. The page also shows which projects provide new support for Java 9, e.g. Eclipse JDT. Those projects are expected to contribute to what we give to the community once Java 9 goes GA. Note that at this point the Planning Council did not yet decide how to do that.

The biggest feature in Java 9 is the Java Platform Module System, a.k.a. Jigsaw. With this, access to internal code of the Java runtime will no longer work. The Planning Council requests every release train project to check whether they use internal code from the Java runtime, or whether they use a library (most likely from Orbit), that does so.

There are several things you to check the readiness for Java 9.

Run and test your project with Java 9

To do this you need to download a Java 9 VM, e.g. from https://jdk9.java.net/. Since the Eclipse SDK uses types that aren't in the java.base module, you need to add the following vmargs to the eclipse.ini: --add-modules=java.se.ee. This step will no longer be necessary with M7 and newer, as the launcher will add this by default. Your project might fail to run because you use types that are neither in java.base or java.se.ee, e.g. types from javafx.base. In that case you have to figure out which module(s) you need to add with --add-modules. You can do this if you run Eclipse with Java 9 Support (BETA) for Oxygen (see below) and then just search the type. The Package Explorer will show the module in which that type resides.

Run your tests with Java 9

You can do this locally or on Hudson. A Java 9 VM is installed on Hudson (bug 469515).

Check whether your project or required libraries use internals of the Java VM

Since Java 8 there is a tool that allows to check whether you use internals of the Java VM. It is called jdeps.exe. There are two ways you can check your code / repository: - There is an Apache Maven JDeps Plugin (https://maven.apache.org/plugins/maven-jdeps-plugin/), - The Eclipse Platform project has created a script (https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/plain/production/reports/jdepsReport.sh) that calls jdeps during the build and generates a report. I suggest to use that approach. Please contact Sravan Lakkimsetti if you have any problems with this script.

NOTE:

1) We made an initial scan of the M5 release train repository and most of the violations are in third party code. You have to work with the providers of the libraries to get this fixed or find an alternative approach.

2) https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool lists alternatives that can be used instead of the internal code. You can see in this list that there's not a replacement for every issue, e.g. sun.misc.Unsafe has no replacement and continues to work, at least for now.

Reflection hacks

Unfortunately jdeps does not detect access to internals made via reflection. You have to check your code for such cases and fix them.

Running with Eclipse with Java 9 Support (BETA)

This is useful if you have to debug problems, e.g. when it fails to run your project. We recommend to install the support via https://marketplace.eclipse.org/content/java-9-support-beta-oxygen/ because it is crucial that the Eclipse install, the Java 9 VM and the patch match. Another way to install it is to use Ed's Oomph based installed described here: https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg14178.html.


Java 9 Readiness

If a release train project is not listed here, it means it did not check it yet and you have to assume it won't run on Java 9. If something does not work it should be covered by a bug report.

Project Contact Runs on Java 9 Adds Java 9 Support
Eclipse Project (Platform, JDT, PDE) Dani Megert Yes, but the module java.se.ee needs to be added and we have an open issue with some Platform UI tests due to org.objenesis (bug 508734). Yes, new code to support Java 9 will be delivered.
. . . .

Back to the top