Private APIs not usable in Java 9?

Chris Newland cnewland at
Thu Apr 9 12:37:17 UTC 2015

I just asked about this on the adoption-discuss at list and
the answer from Martijn Verburg is:

Hi Chris,

I think the strong advice for those using private APIs is to run the jdeps
tool to see where they are using APIs that will go away / be moved. I'd
then get them to post that list to jigsaw-dev, I guess the root cause of
some of these issues should also be logged in JBS and fixed :-).


If you run $JAVA_HOME/bin/jdeps -jdkinternals <class dir or jar> then it
will show all uses of JDK private APIs that will go away in JDK9.

An example from one of my own projects:

chris at chris:~$ /home/chris/jdk1.8.0_40/bin/jdeps -jdkinternals
jitwatch-1.0.0-SNAPSHOT.jar -> /home/chris/jdk1.8.0_40/lib/tools.jar
      ->                      JDK internal
API (tools.jar)
      ->$BadArgs              JDK internal
API (tools.jar)

Warning: JDK internal APIs are unsupported and private to JDK
implementation that are
subject to be removed or changed incompatibly and could break your
Please modify your code to eliminate dependency on any JDK internal APIs.
For the most recent update on JDK internal API replacements, please check:

I think sending these reports to jigsaw-dev at is a
worthwhile effort to help them direct resources for bug fixing and new
public APIs.



More information about the openjfx-dev mailing list