Skip to content

Native Image support for Java Agent #6693

Answered by vjovanov
yswdqz asked this question in Q&A
Discussion options

You must be logged in to vote

The bytecode transformation is best done by passing a Java agent at build time with -J-javaagent:agent.jar to native-image. There are a few things to note:

  • The agent is running and transforming all classes at build time.
  • The agent should not touch the classes that are used by native-image itself. One can get in trouble then as unpredictable things can happen.
  • The premain of the agent will be executed at build time.
  • The agent is currently marked as 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.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@yswdqz
Comment options

@christianwimmer
Comment options

@yswdqz
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by vjovanov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants