-
Notifications
You must be signed in to change notification settings - Fork 21
1 Home
Welcome to the JVMByteSwapTool wiki!
JVMByteSwapTool (jbs) is a jvm diagnose tool that can swap the class bytecode without restart Java process. It's similar to Alibaba Arthas, but more lightweight, less code, also less features. I just add several most useful features to this tool. This tool has a very user-friendly web UI. It is easy to use, yet it possesses powerful features.
Prepare java environment, of course, it's needed. This tool is built by Java 1.8, so you need a Java >= 1.8.
Download swapper.jar file with lastest verion from release page, unzip the file, get a swapper.jar.
First, start up a java process that you want to attach and swap bytecode. If you just want to have a try, you can run the demo.jar in the demo directory of this github repo. It's a simple spring boot project, here is the source code.
$ java -jar demo/demo.jar
# sprint start...
$ curl 'http://localhost:8080/add?a=1&b=2'
3
$ curl 'http://localhost:8080/base64?str=123'
Base64(123) = MTIz
$ curl 'http://localhost:8080/user/1'
{"id":1,"name":"A"}Secondly, run the swapper.jar to attach this process.
$ java -jar swapper.jar
# choose the process
Visit url http://localhost:8000, the web ui is showed as following.

Go to the usage wiki page, will show you how to use the jbs tool.
In some cases, local network cannot connect to the server. So that, the web ui is unaccessable. You can also use the tui named jbs-client, also can get it from release page.
Similar with web ui, using tab to change selection, enter to select.
