Use java.lang.instrument without writing an agent.