mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
- docs: add config.md documenting the v2 schema ([JuiceAgent] / [JarLoader]), key defaults and the BuiltIn / CustomJar modes - docs: rewrite advanced.md around the JarLoader.Mode = CustomJar workflow instead of the removed JUICEAGENT_API_* environment variables - readme: migrate the Quick Start config example from v1 to v2 and link docs/config.md, list inject-via-java-api under Examples - examples: update inject-via-java-api HowToUse docs (.md/.txt, EN/ZH) to the v2 config
1.0 KiB
1.0 KiB
Advanced
Load Custom API / Directly Load Jar
JuiceAgent runs in BuiltIn mode by default: libloader registers the embedded
JuiceAgent-API jar, the agent bootstraps it, and the JarLoader module loads your JAR
and invokes its entry method.
If you don't need JuiceAgent-API — for example you want to provide your own bootstrap
and call an arbitrary class/method — set JarLoader.Mode to CustomJar:
[JuiceAgent]
Version = 2
[JarLoader]
Mode = "CustomJar"
JarPath = "./my-agent.jar"
EntryClass = "com.example.MyBootstrap"
EntryMethod = "start"
Workflow in CustomJar mode:
libloaderattaches to the target JVM and readsconfig.toml.- It adds
JarPathto the system class loader search path. JuiceAgent-API is not loaded. - It invokes
EntryClass.EntryMethod.
EntryMethod must be a public static void method that takes no arguments.
JarLoader.EnabledandJarLoader.InjectionDironly apply toBuiltInmode; they are ignored inCustomJarmode.
See Configuration for the complete list of keys.