Skip to content

sunwu51/JVMByteSwapTool

Repository files navigation

JVM ByteSwap Tool

logo

actions

A tool that can hot swap the class byte code while jvm is running. Very suitable for SpringBoot framework.

Based on the jvm instrumentation tech, ASM, javassist and JVMTI.

Usage

Download the zip file from the release page.

Make sure you have a JDK >= 1.8.

$ java -jar swapper.jar

// All of the java processes will be listed in following
// Choose the pid you want to attach
// Then a web ui will be served at http://localhost:8000

Visit this url http://localhost:8000 then you will get the following Web UI.

If you want to change the http server port or web socket port:

$ java -jar -Dw_http_port=9999 -Dw_ws_port_19999 swapper.jar

image

Now you can enjoy the functionalities of swapper tool.

For example, Watch some methods. Trigger this method, and then the params and return value and execution time cost will be printed.

image

It's Watch one of the functions provided by swapper tool.

Get more functions and details from the wiki.