support ARTHAS_LIB_DIR env. close #1861

This commit is contained in:
hengyunabc
2021-07-14 16:58:00 +08:00
parent c58e461ec1
commit 1c9144a5a0
2 changed files with 11 additions and 3 deletions
@@ -132,8 +132,14 @@ public class Bootstrap {
private String disabledCommands;
static {
ARTHAS_LIB_DIR = new File(
System.getProperty("user.home") + File.separator + ".arthas" + File.separator + "lib");
String arthasLibDirEnv = System.getenv("ARTHAS_LIB_DIR");
if (arthasLibDirEnv != null) {
ARTHAS_LIB_DIR = new File(arthasLibDirEnv);
} else {
ARTHAS_LIB_DIR = new File(
System.getProperty("user.home") + File.separator + ".arthas" + File.separator + "lib");
}
try {
ARTHAS_LIB_DIR.mkdirs();
} catch (Throwable t) {