Attaching to a JVM image that does not include java.instrument

Rafael Winterhalter rafael.wth at
Fri May 19 10:57:15 UTC 2017

Hi Alan,
I understand your current time constraint, I still want to point out that
this is a heavily used functionality and it not being available would cause
problems in basically all production environments I am aware of where the
lack of this API is not uncovered before running the application in some
production or production-like environment. And while JVMTI might be
optional in the spec, this is not how it is treated in practice. Therefore,
I want to make this point against not having JVMTI available on the default
jlink image but rather to include it by default. This can always change in
a future version when this issue is better understood. As said, while it is
not used by many people, a large number of Java users rely on it for their
and third party application as basically any Java tooling is built around
this. I just verified that this would be an issue for my current client
where a lack of JVMTI would result in an infinite restart loop.
Best regards, Rafael

2017-05-19 12:24 GMT+02:00 Alan Bateman <Alan.Bateman at>:

> On 19/05/2017 10:20, Rafael Winterhalter wrote:
> :
>> It is the exact purpose of a Java agent to allow the enhancement of a
>> Java application that is independent of a particular Java process.
>> Therefore, it should not be a decission bound to the creation or bundeling
>> of the Java application if such user-site monitoring is required. Instead,
>> it should always be possible to attach a Java agent for a standalone Java
>> process. Also, I cannot find any comment about the Java agent functionality
>> to be optional despite the mentioned change set:
>> nt/package-summary.html - Neither would anybody using the functionality
>> expect it to be optional. I work with agents everyday and this is the first
>> time I hear it.
>> I don't have time to debate this topic just now but just on optionally,
> the tool interfaces have always been optional. It might need digging to
> find all the history but as I recall, in 2004 the then in-progress JSR-163
> spec was clarified to make the optionality clear. This is why the JVM TI
> spec has the statement "JVM TI may not be available in all implementations
> of the JavaTM virtual machine". The wording in the java.lang.instrument
> package description wasn't as clear, something that came to light when
> shaking out the details of Compact Profiles for Java SE 8. This lead to a
> small clarification [1] that I mentioned.
> -Alan.
> [1]

More information about the jigsaw-dev mailing list