Why doesn't jdk.hotspot.agent export anything?
Volker Simonis
volker.simonis at gmail.com
Wed Mar 1 13:23:01 UTC 2017
Hi,
I understand that the SA API is an unofficial, unsupported API which
is constantly evolving and changing. But at least its JavaDoc has been
made available recently [1] (and I really welcome and appreciate
that).
Unfortunately, with Java 9 and the new module system it becomes very
inconvenient to use the SA API for own tools because the
jdk.hotspot.agent has no unqualified exports at all. So from my
understanding, even for a relatively small SA application, I need a
command line like:
javac --add-modules jdk.hotspot.agent
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.classfile=ALL-UNNAMED
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.tools=ALL-UNNAMED
MySAApp.java
Running it isn't any simpler:
java --add-modules jdk.hotspot.agent
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.classfile=ALL-UNNAMED
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED
--add-exports jdk.hotspot.agent/sun.jvm.hotspot.tools=ALL-UNNAMED
MySAApp java core
Is this intended or do you plan to simplify this by opening
jdk.hotspot.agent by exporting its packages? Or maybe there's a
simpler way of using the SA API in jdk9 which I've completely missed?
Thank you and best regards,
Volker
[1] http://docs.oracle.com/javase/8/docs/serviceabilityagent/
More information about the serviceability-dev
mailing list