有些人对你恭维不离口,可全都不是患难朋友——莎士比亚
按照官方文档的快速入门
执行:
curl -O https://arthas.aliyun.com/math-game.jar
java -jar math-game.jar然后再执行
curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar然后问题来了

提示:
$ java -jar arthas-boot.jar
[INFO] JAVA_HOME: C:\Program Files\Java\jre1.8.0_351
[INFO] arthas-boot version: 3.6.7
[INFO] Can not find java process. Try to run `jps` command lists the instrumented Java HotSpot VMs on the target system.
Please select an available pid.找不到java进程,可我明明已经启动,它提示使用jps寻找java进程
执行jps,提示bash: jps: command not found
仔细看,我这里是JAVA_HOME: C:\Program Files\Java\jre1.8.0_351
这不是jdk。。。而是jre
修改了环境变量(关掉bash窗口后)再次执行jps后发现没有jps: command not found的报错了
但是仍然没有找到我想要的java进程,并且执行java -jar arthas-boot.jar后发现仍然是提示Please select an available pid.而没有让我选
将所有bash全部使用管理员身份打开,再次执行,终于成功!
我们执行一下dashboard命令

以及
thread 1 | grep 'main('
还有反编译
jad demo.MathGame
使用watch查看返回值
watch demo.MathGame primeFactors returnObj然后按ctrl+c退出,结果直接退出了arthas
再次运行java -jar arthas-boot.jar提示已经存在

一般我们遇到这种情况直接使用
taskkill -f -pid 82304但有时候,没有提示出具体的进程ID,只有一个端口号,我们则可以使用
netstat -ano | findstr :3658查询到进程ID后即可结束

再次运行arthas即可