Why doesn't jdk.hotspot.agent export anything?

Volker Simonis volker.simonis at gmail.com
Thu Mar 2 13:31:17 UTC 2017


On Thu, Mar 2, 2017 at 10:00 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 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.
>

I didn't had the impression that this was a mistake. At least it was
advertised on " The Java Tuturials Blog"

https://blogs.oracle.com/thejavatutorials/entry/hotspot_serviceability_agent_api_javadoc

which seems to be a more or less 'offical' Oracle blog.

I just think that not everything that's not supported necessarily has
to be closed. The SA APIs are definitely quite useful, even if they
are not supported in any way.

Regards,
Volker

> -Alan


More information about the serviceability-dev mailing list