Skip to content

Zukkari/venom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

venom

A tool to inject Java Agents into JVM at runtime.

Typically to inject an agent you have to compile it into the jar and provide it as a javaagent: attribute when starting JVM. This tool allows you to do this at runtime, without restarting the JVM.

This tool does:

  • Creates a jar for you with correct manifest attributes
  • Attaches it to the JVM
  • Schedules shutdown hook to delete the .jar after before JVM shutdown.

Usage examples:

val result = Venom.inject(MyAgent::class.java)
when (result) {
    is Either.Success -> // Injected successfully
    is Either.Left -> // Injection failed
}
val config = AgentConfiguration.new<MyAgent>(
                canRedefineClasses = false,
                canReTransformClasses = false,
                canSetNativeMethodPrefix = false)

val inject = Venom.inject(config)
when (inject) {
    is Either.Left -> // success
    is Either.Right -> // err
}

About

JVM agent injector

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages