目录
[1.1 Windows安装](#1.1 Windows安装)
[1.2 小结](#1.2 小结)
[1.3 linux安装](#1.3 linux安装)
一、在线安装
1.1 Windows安装
本地指定目录下(例如我是:F:\测试\arthas),使用Windows的cmd窗口,执行如下命令则会将jar包下载下来。大小是138k。(当然未来不同版本可能不一样)
bash
curl -O https://arthas.aliyun.com/arthas-boot.jar


此时,我们通过java -jar 的方式,尝试运行这个jar包试试。

我们发现程序自动停止了,因为它找不到运行的Java进程。说明这个jar包需要当前环境下有java进程运行才能启动。
我们打开idea,跑一个Springboot项目,再试试。


此时就启动了,它说让我们选择一个正在运行的进程输入前面那个编号,然后按Enter键。
那我们就运行第四个吧,它是我们刚才启动的SpringBoot项目。

这时它会自动去远程下载arthas相关j文件到本地目录,下载完成后会自动运行arthas项目。
这样就算自动安装完成了,并且还运行了。
通过窗口可以看到它默认安装的目录。


1.2 小结
在指定目录下载arthas-boot.jar包
bash
curl -O https://alibaba.github.io/arthas/arthas-boot.jar
然后运行arthas-boot.jar包
bash
java -jar arthas-boot.jar
💡提示:
当前系统必须有Java进程存在,否则无法运行成功。
运行后会自动下载arthas相关jar包,这些jar包在C:\Users\hssym\.arthas\lib\3.7.1\arthas路径下。
1.3 linux安装
安装步骤和windows是一样的。话不多说直接实操



二、离线安装
删除arthas
前面我们在线安装了一遍,在离线安装前,我的建议是删除掉之前在线安装的文件。
当然不删除也可以,它只不过是一个个文件而已。不会有什么影响。
bash
rm -rf ~/.arthas/
rm -rf ~/logs/arthas
rm -rf /opt/module/arthas-boot.jar
rm -rf /opt/module/arthas-output/
先下载好安装包,推荐通过maven仓库下载。
下载地址:
上传服务器并解压
bash
unzip -d arthas arthas-packaging-3.1.7-bin.zip

然后启动arthas-boot项目即可。