You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
在Arthas里有一些开关, 可以通过 `options` {{execute T2}} 命令来查看。
查看单个option的值, 比如
`options unsafe` {{execute T2}}
## 允许增强JDK的类
默认情况下`unsafe`为false, 即watch/trace等命令不会增强JVM的类, 即`java.*`下面的类。
如果想增强JVM里的类, 可以执行 `options unsafe true` {{execute T2}} ,设置`unsafe`为true。
## 以JSON格式打印对象
当 `json-format` 为false时, 输出结果是:
```bash
$ ognl '#value1=@System@getProperty("java.home"), #value2=@System@getProperty("java.runtime.name"), {#value1, #value2}'
@ArrayList[
@String[ /usr/lib/jvm/java-8-oracle/jre] ,
@String[ Java( TM) SE Runtime Environment] ,
]
```
`options json-format true` {{execute T2}}
当 `json-format` 为true时, 输出结果是:
```bash
$ ognl ' #value1=@System@getProperty("java.home"), #value2=@System@getProperty("java.runtime.name"), {#v["/usr/lib/jvm/java-8-oracle/jre","Java(TM) SE Runtime Environment"]
```