-
Hi 👋 I've read #1065, and other issues about javaagent. It appears that javaagent is not officially supported. Does this mean that I can go about getting native-image to support javaagent in my own way? Thank you for considering my request. Any help is really appreciated ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
We are working on basic support for JVMTI agents (so agents written in C). We can support some of the JVMTI capabilities there, but certainly not any kind of bytecode transformation. But I assume with "Java Agents" you mean the Java instrumentation API. This API does not really support much more than bytecode transformation, and since that cannot be done at image run time, there is not much point in loading such agents at run time. All bytecode transformation must be done at image build time. |
Beta Was this translation helpful? Give feedback.
-
The bytecode transformation is best done by passing a Java agent at build time with
If you encounter issues please contact me via our community Slack. |
Beta Was this translation helpful? Give feedback.
The bytecode transformation is best done by passing a Java agent at build time with
-J-javaagent:agent.jar
tonative-image
. There are a few things to note:native-image
itself. One can get in trouble then as unpredictable things can happen.premain
of the agent will be executed at build time.link-at-build-time
so all of the classes need to be present in the agent jar.If you encounter issues please contact me via our community Slack.