https://github.com/sunwu51/swapper
jvm diagnose tool by swapping bytecode
https://github.com/sunwu51/swapper
asm attach bytecode debugging-tool diagnose hotswap javassist jvm
Last synced: 9 days ago
JSON representation
jvm diagnose tool by swapping bytecode
- Host: GitHub
- URL: https://github.com/sunwu51/swapper
- Owner: sunwu51
- License: mit
- Created: 2023-11-26T15:44:38.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2026-06-19T07:02:05.000Z (11 days ago)
- Last Synced: 2026-06-19T08:27:37.583Z (11 days ago)
- Topics: asm, attach, bytecode, debugging-tool, diagnose, hotswap, javassist, jvm
- Language: Java
- Homepage: https://www.bilibili.com/video/BV1TmWWeYEie
- Size: 40.9 MB
- Stars: 86
- Watchers: 2
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JVM ByteSwap Tool


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 `swapper.jar` from the [release](https://github.com/sunwu51/JVMByteSwapTool/releases) page.
Make sure you have a JDK >= 1.8.
```bash
$ java -jar swapper.jar
// All of the java processes will be listed
// Choose the pid you want to attach
// Then the backend service will start
```
If you want to change the HTTP server port or WebSocket port:
```bash
$ java -jar -Dw_http_port=9999 -Dw_ws_port=19999 swapper.jar
```
## Web UI
After `swapper.jar` starts, visit `http://localhost:8000` and use the Web UI.

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.

It's `Watch` one of the functions provided by swapper tool.
Get more functions and details from the [wiki](https://github.com/sunwu51/JVMByteSwapTool/wiki).
## TUI CLI
You can use the TUI client in the same way as the Web UI.
Install it from npm:
```bash
$ npm i -g jbs-client
$ jbs-client
```
Or download the standalone binary for your platform from the [jbs-client-opentui releases](https://github.com/sunwu51/jbs-client-opentui/releases), then run:
```bash
$ jbs-client
```
The interaction flow is consistent with the Web UI.
