Your problems are caused by changes to Project Jigsaw that are included in the Java 9 EA build that you seem to have used. JEP 220 describes them.
The Deleted section : rt.jar and tools.jar describes this in more detail, but Risks and Assumptions contain a good summary:
JDK and JRE images, as noted above, no longer contain the lib/rt.jar , lib/tools.jar , lib/dt.jar and other internal jar files. Existing code suggesting the existence of these files may not work correctly.
So, as you noticed, these files have disappeared. Further down:
Class and resource files previously found in lib/tools.jar and visible only when this file was added to the class path will now be displayed as JDK through the system class loader or, in some cases, the boot class loader, However, the modules, containing these files will not be mentioned in the class path of the application, i.e. In the value of the system property java.class.path .
So, classes from tools.jar move into modules, but it seems that they may not be available to the user. You should use jdeps from the recent Jigsaw build ...
- ... to determine the dependencies of your module:
$jdeps -M -s $your_JAR - ... for defining dependencies on JDK internal APIs:
jdeps -jdkinternals $your_JAR
If you're lucky, the API you are using has been published (then it will not be displayed in the second analysis) or have a public alternative (which will be displayed in the second analysis). Otherwise, you should think about it on the Jigsaw mailing list and ask for help there, indicating explicitly which APIs you are using and for what.
source share