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.
arthas/tutorials/katacoda/arthas-advanced-cn/options.md

37 lines
999 B
Markdown

在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"]
```