Why doesn't jdk.hotspot.agent export anything?
Alan Bateman
Alan.Bateman at oracle.com
Thu Mar 2 09:00:17 UTC 2017
On 01/03/2017 13:23, Volker Simonis wrote:
> 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
As you noted, SA isn't a supported API so this is why jdk.hotspot.agent
doesn't export any packages unconditionally. I don't know what the
javadoc was published via the link you posted, this seems to be a mistake.
-Alan
More information about the serviceability-dev
mailing list